HTML Table to CSV Converter
Extract HTML tables and convert to CSV, TSV, JSON, SQL, or Markdown format
Paste raw HTML containing tables, and this tool extracts every row and column into CSV, TSV, JSON, SQL, or Markdown — merged cells, rowspans, and nested tables included. Pick your format, adjust delimiters or quoting, and copy or download the result. And everything runs in your browser. Nothing gets uploaded.
How It Works
The parser reads your HTML into a temporary DOM, finds every <table> element (or just the ones matching your CSS selector), and walks through rows and cells. Colspan and rowspan get expanded so each cell lands in its correct column. After that, the tool formats everything into your chosen output — CSV with proper quoting, tab-separated values, JSON objects, SQL INSERT statements, or a Markdown table.
Examples
Simple product table from an ecommerce page
You scraped a competitor's product listing and need the data in a spreadsheet.
<table>
<tr><th>Product</th><th>Price</th></tr>
<tr><td>Widget A</td><td>$12.99</td></tr>
<tr><td>Widget B</td><td>$8.50</td></tr>
</table>
Product,Price
Widget A,$12.99
Widget B,$8.50
Table with merged cells (colspan + rowspan)
Financial reports love merged headers. Most converters choke on these — this one doesn't.
<table>
<tr><th rowspan="2">Region</th><th colspan="2">Sales</th></tr>
<tr><th>Q1</th><th>Q2</th></tr>
<tr><td>North</td><td>4500</td><td>5200</td></tr>
<tr><td>South</td><td>3800</td><td>4100</td></tr>
</table>
Region,Sales,Sales
,Q1,Q2
North,4500,5200
South,3800,4100
Exporting to JSON instead of CSV
Need the data for an API or a script? Switch the output format to JSON Objects.
<table>
<tr><th>Name</th><th>Role</th></tr>
<tr><td>Alice</td><td>Engineer</td></tr>
<tr><td>Bob</td><td>Designer</td></tr>
</table>
[
{"Name": "Alice", "Role": "Engineer"},
{"Name": "Bob", "Role": "Designer"}
]
Who Uses This
Scraping table data from websites and feeding it into databases or pipelines.
Pulling stats tables from government or research pages into Excel for analysis.
Migrating table content from an old CMS into a new platform's import format.
Grabbing data tables from published papers or Wikipedia for class projects.
Common Mistakes
The converter will try to find tables in whatever you paste, but a 500KB page source will slow things down. Copy just the <table>...</table> section using your browser's Inspect Element tool. Much faster.
A colspan="3" cell gets expanded into 3 columns with the same value. That's how HTML tables actually work — the cell spans multiple positions. If you want different values in each, you'll need to edit the CSV after conversion.
Excel sometimes guesses the wrong delimiter, especially on European systems where commas are decimal separators. If your CSV looks like one giant column in Excel, try switching to TSV output — Excel always handles tabs correctly.
Technical Details
- Processing: 100% client-side — HTML is parsed in a sandboxed DOM, never sent to a server
- Browser Support: Chrome, Firefox, Safari, Edge (all modern versions)
- Output Formats: CSV, TSV, JSON (objects or arrays), SQL INSERT, Markdown
- Table Features: Colspan, rowspan, nested tables, caption extraction, CSS selector filtering
- Input Limit: No hard limit — handles pages with 10,000+ rows, though very large inputs may be slow
Frequently Asked Questions
How do I convert an HTML table to CSV?
Copy the HTML source containing the table (right-click the page, View Source, then copy the <table> block). Paste it into the input area here and click Convert. The CSV output appears instantly. You can also paste the entire page — the tool will find all tables automatically.
Can this handle tables with merged cells?
Yes. Colspan and rowspan attributes are fully supported. A cell spanning 3 columns gets expanded into 3 CSV fields with the same value, which matches how the table visually renders. The preview panel shows you exactly how the data will look before you convert.
Is my data safe? Does anything get uploaded?
Nothing leaves your browser. The HTML is parsed locally using JavaScript — there is no server involved and no network requests. Your data stays on your machine the entire time. Close the tab and it is gone completely.
Why does my CSV look like one column in Excel?
This usually happens because Excel isn't detecting the comma delimiter, which is common on systems that use commas as decimal separators (like many European locales). Two fixes: switch the output to TSV (tab-separated), which Excel always reads correctly, or use Excel's "Data > From Text" import wizard where you pick the delimiter yourself.
What if my page has multiple tables?
All tables are detected and listed in the preview panel. You can convert all of them at once or pick specific ones using the table selector dropdown. If you only want a particular table, the CSS selector field lets you target it directly — for example, .data-table or #results.