ConvertCSV

Converter tool

HTML Table to CSV Converter

Convert HTML tables into downloadable CSV files

Preview

Output Preview

No output yet. Upload or paste input and convert.

HTML Table to CSV Converter

Web pages, email reports, and CMS exports often lock useful data inside HTML <table> elements. Copying cell by cell into Excel is slow and error-prone. This free HTML table to CSV converter parses table markup in your browser, extracts headers and cell text, and produces clean CSV rows you can open in Excel, Google Sheets, or another converter.

Paste a full page’s HTML or just a <table>...</table> block. The tool finds the table, reads <th> headers when present, decodes entities like &amp; and &nbsp;, and flattens cells into a spreadsheet-friendly grid. Your pasted HTML is not uploaded to a server as part of the conversion.

Below you will find how to copy the right markup (page source vs rendered DOM), how colspan/rowspan are handled, what happens with multiple tables, Excel pitfalls after download, and a full troubleshooting and FAQ section for real web-to-spreadsheet workflows. Use the preview as your source of truth before you download or share the file.

Key features

  • Finds <table> elements automatically in pasted markup — no need to isolate the table tag yourself.
  • Generates column names from <th> headers, or falls back to Column1, Column2, etc. if none are present.
  • Decodes HTML entities (&amp;, &nbsp;, &#39;) into their actual characters before writing CSV cells.
  • Applies best-effort flattening to colspan and rowspan so merged cells do not collapse the whole table.
  • Works from copy-pasted page source, not just clean hand-written HTML.
  • Runs entirely in the browser using the DOM parser so markup is not sent to a server for conversion.
  • Produces standard CSV ready for Excel, Google Sheets, or further converters on this site.

About the HTML table to CSV format

HTML tables use <table>, <tr>, <th>, and <td> to present rectangular data in a browser. CSV is a plain-text grid with a header row and one row per record. Conversion means walking the table’s rows and projecting each cell’s text content into columns.

The parser loads your markup into a DOM tree, finds a <table>, treats the first row as headers when <th> cells exist (or generates Column1, Column2, … when they do not), and maps every following <tr> to a CSV row. HTML entities are decoded to real characters before writing cells.

Merged cells (colspan/rowspan) have no native CSV equivalent. The converter applies best-effort flattening—typically duplicating spanned values—so columns stay aligned as much as possible. Nested tables and layout tables used for page design may need you to paste only the data table you care about.

How it works

The parser loads the pasted markup into a DOM tree and searches for the first <table> element (or the table present when you paste an isolated block). It reads the first <tr> as the header row, using <th> text if present or generating Column1, Column2-style names if the table only has <td> cells.

Every following <tr> becomes one CSV row: each <td>’s text content is extracted and HTML entities within it are decoded to their literal characters.

Cells using colspan or rowspan are handled with best-effort duplication of the spanned value across the affected columns, since CSV has no native concept of merged cells. The result is escaped for spreadsheet use and ready to copy or download.

Common use cases

  • Extracting a pricing comparison table from a vendor’s web page for internal analysis.
  • Converting an HTML report emailed by a legacy system into CSV for a modern dashboard.
  • Pulling product specification tables from a documentation page into a spreadsheet.
  • Extracting grade or score tables from an LMS HTML export.
  • Saving a wiki or Confluence-style HTML table for offline editing in Sheets.
  • Turning a public open-data HTML table into CSV when no download button exists.

How to use this tool

  1. Copy the HTML for the table — either the full page source, the rendered DOM node, or just the <table>...</table> block — and paste it in.
  2. Confirm the preview shows the intended headers and row count.
  3. Check for misaligned columns, which usually indicates merged cells (colspan/rowspan) in the source.
  4. Rename generic ColumnN headers if needed, then copy or download the CSV.
  5. Open a sample in Excel or Sheets and verify currencies, dates, and ID-like columns.

Example

Input HTML

<table>
  <tr><th>Name</th><th>Price</th></tr>
  <tr><td>Widget</td><td>$9.99</td></tr>
  <tr><td>Gadget</td><td>$14.50</td></tr>
</table>

Output CSV

Name,Price
Widget,$9.99
Gadget,$14.50

Tips for best results

  • Paste the full HTML or just the <table>...</table> block — both work.
  • If the table has no <th> headers, rename Column1, Column2, … afterward in the Online CSV Editor.
  • For pages with multiple tables, paste one table at a time for the cleanest output.
  • Use View Page Source for static tables; use DevTools Elements for JavaScript-rendered tables.
  • Strip navigation chrome and ads from the paste when possible so the intended <table> is obvious.
  • Spot-check currency symbols and encoded characters in the preview before download.
  • After download, verify column counts on a few rows that had merges in the original HTML.

Common errors and how to fix them

The output is empty even though the page clearly shows a table.
The table you see may be rendered by JavaScript and not present in the actual HTML source. Right-click the page and choose View Page Source (not Inspect Element) only for static HTML, or use your browser's DevTools Elements panel to copy the rendered <table> DOM instead.
Merged cells (colspan or rowspan) cause columns to shift out of alignment in some rows.
CSV has no concept of merged cells, so the converter duplicates the spanned value across the affected columns as a best effort. For complex spanning layouts, you may need to manually fix a few rows in the editor after conversion.
Special characters like &amp; or accented letters show up as HTML codes instead of the actual character.
Entities are decoded automatically in normal cases. If you still see raw codes, the source may use an unusual entity form; try copying text from the rendered table or cleaning entities in a small preprocess step.
The page has multiple tables and the wrong one was converted.
Paste just the specific <table>...</table> block you want instead of the whole page, so there is no ambiguity about which table to parse.
Extra empty columns appear at the end of every row.
The source row may include empty <td> cells used for spacing, or colspan math left trailing slots. Delete unused columns in the Online CSV Editor after conversion.
Links or buttons appear as concatenated text in a cell.
The converter uses text content, not structured link fields. If you need URLs separately, use the HTML links to CSV tool or extract href values with a dedicated scrape.

Best practices

  • Paste one table at a time when a page has multiple tables, for the cleanest and most predictable output.
  • Use View Page Source for static tables; use the rendered DOM from DevTools when the table is built by JavaScript.
  • Review the output preview for missing header names — rename generic ColumnN labels before sharing.
  • For tables with heavy colspan/rowspan use, expect to do a small amount of manual cleanup after conversion.
  • Prefer semantic data tables (<th> scope, simple grids) over nested layout tables when you control the HTML.
  • Keep the original HTML snippet until you confirm row counts and a few merged-cell rows look right.
  • Document the page URL and date when the extract is used for decisions — web tables change often.

What HTML table to CSV conversion actually does

Browsers display tables for people. Spreadsheets and pipelines need flat files. This conversion reads the DOM structure of an HTML table and writes each visible cell’s text into a CSV grid.

You keep labels and values, not styling, scripts, or interactive widgets. That is usually what you want for analysis, imports, and sharing with teammates who live in Excel.

It is not a full web scraper: it does not log in, click pagination, or wait for network calls. You paste markup that already contains the table you need.

When to convert HTML tables to CSV

Convert when a site shows data in a table but offers no export, when an email report is HTML-only, or when documentation embeds specs you need offline.

Skip conversion if the site provides an official CSV/API — prefer the authoritative feed. Skip if the “table” is actually a grid of divs without <table> markup unless you reconstruct a real table first.

A practical pattern: copy the table HTML, convert to CSV, clean headers, then feed other converters (JSON, SQL, Excel) as needed.

  • Good fit: vendor pricing tables, HTML email reports, wiki specs, LMS grade tables.
  • Poor fit: infinite-scroll grids without a static <table>, canvas-drawn charts, PDF screenshots.
  • Better as a script: recurring scrapes with pagination, auth, and change detection.

Page source vs Inspect Element vs rendered DOM

View Page Source shows the HTML as delivered by the server. Static CMS tables often appear there and paste cleanly.

Modern apps inject rows with JavaScript after load. Source may lack the <table> even though you see one. In DevTools Elements, locate the rendered <table>, right-click → Copy → Copy outerHTML, then paste here.

Inspect Element highlights nodes but copying the wrong ancestor can include layout wrappers. Prefer copying the <table> node itself.

Headers, <th> vs <td>, and missing labels

When the first row uses <th>, those labels become CSV headers. That is the cleanest outcome for downstream tools.

Some tables put labels only in the first <td> row or use no headers at all. You will get Column1, Column2, … — rename immediately so colleagues understand the sheet.

Multi-row header sections (grouped headers) do not map neatly to one CSV header row. Flatten mentally: pick the leaf labels you need, or clean after conversion.

Colspan, rowspan, and merged cells

Merged cells are a visual HTML feature. CSV needs a value in every column of every row. Best-effort flattening duplicates spanned text so later columns do not shift left incorrectly.

Complex financial or academic tables with many merges may still need hand fixes. Convert, then repair a few rows in the Online CSV Editor rather than rebuilding the whole sheet.

If merges are rare, note which rows looked wrong in preview and fix only those — usually faster than abandoning the extract.

Entities, whitespace, and hidden content

Entities such as &amp;, &lt;, and &nbsp; should become &, <, and spaces/non-breaking spaces as appropriate. Odd numeric entities usually decode too; stubborn cases may need a second pass.

Extra whitespace inside cells is often collapsed to readable text. Preserve exact spacing only if your use case needs it — most spreadsheet workflows do not.

Nodes with display:none can still exist in the DOM. If mystery columns appear, inspect whether the HTML includes hidden cells for responsive layouts.

Multiple tables and nested tables

Pages often include several <table> elements: one for layout, one for data, one for footers. Pasting the whole document can pick the wrong first table. Isolate the data <table> block.

Nested tables (a table inside a cell) confuse flattening. Copy the inner or outer table intentionally depending on which grid holds the records you need.

When in doubt, paste progressively smaller fragments until the preview matches the on-screen data table.

Excel, Sheets, and after-download cleanup

CSV opens widely but Excel may auto-convert values that look like dates or numbers. Format ID columns as Text when needed.

Currency symbols and locales vary. Spot-check prices. If everything landed in one column, your locale may expect semicolons — use Text Import with comma selected.

Rename headers, drop empty columns, and remove total/footer rows that are not data records before charting or importing elsewhere.

Typical workflows

Competitive pricing: copy a competitor’s HTML table weekly, convert, and archive CSV snapshots for trend charts.

Legacy email reports: save the HTML, extract the results table, load CSV into a dashboard tool.

Docs to data: pull parameter tables from HTML docs into Sheets for engineering review.

Education/admin: export LMS HTML views that lack CSV download and grade offline.

Browser limits, privacy, and sensitive pages

Parsing is local. Pasted HTML is not sent to Convert CSV servers for the transform. Site analytics and advertising follow the privacy policy separately.

Huge pages with enormous tables can slow the tab. Paste only the table fragment when possible.

Internal HR, finance, or student tables may contain PII. Even with local conversion, control who receives the CSV and avoid pasting secrets into shared machines carelessly.

HTML table to CSV versus scraping scripts

Scripts (Beautiful Soup, Playwright, etc.) win for pagination, login, and scheduled jobs. They also handle non-table grids more flexibly.

This converter wins for one-off extracts: see a table, copy markup, download CSV in seconds without writing selectors.

If you convert the same URL every week, that is the signal to automate with a small scraper and keep this tool for ad hoc pages.

Quality checklist before you share the CSV

Confirm row count roughly matches the on-screen table (excluding decorative header/footer rows if you dropped them). Confirm headers are meaningful. Spot-check a merged-cell region.

Open in the recipient’s spreadsheet app. Verify encoding for non-ASCII text. Note the source URL and capture date in a cell or filename when the extract informs a decision.

  • Correct table selected (not a layout table).
  • Headers renamed if they were ColumnN.
  • Merged cells reviewed.
  • Entities/characters look correct.
  • Source URL/date recorded when needed.

Email HTML and CMS quirks

Email clients wrap tables in extra markup and use spacer cells. Pasting the innermost data table usually works better than the entire message HTML.

CMS “tables” sometimes export as stacks of divs styled to look like grids. Without real <table> tags, this tool cannot invent structure — ask for a CSV export or rebuild a simple HTML table first.

Copying from a rendered email preview in a browser is often easier than from a desktop Outlook source view, depending on the client.

Accessibility tables and screen-reader markup

Well-built accessible tables may include caption, thead, tbody, and scope attributes. Those help humans and assistive tech; for CSV you mainly care about the text in header and data cells. Captions are not automatically turned into a CSV title row — add a note in your filename or a metadata cell if you need the caption preserved.

Some sites duplicate headers for mobile layouts (one table for desktop, one for small screens). Pasting the whole page can yield two similar tables; pick the desktop data table unless you intentionally want the mobile variant.

If header cells use abbreviations with title tooltips, you usually get the visible abbreviation text, not the tooltip. Expand abbreviations in the sheet when clarity matters for stakeholders.

Related tools and next steps

Need a real .xlsx attachment instead of CSV? Use HTML Table to Excel. Need URLs from a page rather than a grid? Try HTML Links to CSV.

Clean headers and blank rows in the Online CSV Editor, then continue to JSON, SQL, or Markdown with the other CSV output tools. Site guides cover delimiters and Excel import issues when the open step misbehaves.

Frequently asked questions

Do I need to copy just the table, or can I paste the whole page?

Either works — the converter searches the pasted markup for <table> elements, so a full page's HTML is fine as long as the target table is somewhere in it. Isolating one table is still safer when many tables exist.

What if the table has no header row?

The converter generates generic column names (Column1, Column2, etc.) so the rows still convert — you can rename the headers afterward in the CSV or in the Online CSV Editor.

Can this extract tables rendered by JavaScript frameworks like React?

Not from raw page source alone. Copy the rendered <table> from your browser's DevTools Elements panel (Copy outerHTML) after the page has finished rendering.

How are colspan and rowspan handled?

The converter applies a best-effort flattening, duplicating a spanned cell's value across the columns or rows it visually covers, since CSV cannot represent merged cells natively.

Is the pasted HTML sent to a server?

No. All parsing happens in your browser's own DOM engine. See the Privacy Policy for site analytics and advertising.

Is there an Excel version of this converter?

Yes. Use the HTML Table to Excel converter if you need a downloadable .xlsx file instead of CSV text.

What about tables made of divs instead of <table>?

This tool expects real HTML table elements. Div-based grids need a scraper or manual reconstruction into a <table> or CSV.

Can I convert multiple tables at once into one CSV?

Prefer one table per conversion so headers stay coherent. Combine CSVs afterward only when columns intentionally match.

Why do I see HTML tags inside some cells?

Some cells contain nested markup; text extraction may include leftover fragments in edge cases. Clean those cells in the editor, or simplify the HTML before pasting.

Is there a file size limit?

There is no fixed server quota, but very large HTML documents can slow the browser. Paste only the table fragment when possible.

Will images inside cells be included?

No. Conversion uses text content. Alt text might appear if present as text; image binaries are not exported into CSV.

How do I turn the CSV into JSON or SQL next?

Use the CSV to JSON or CSV to SQL converters on this site after you are happy with the table extract.

For more background on data formats and conversion workflows, read our format guides or browse the converter blog for step-by-step walkthroughs linked to each tool.