HTML Table to CSV
Paste an HTML table and extract the data as CSV, TSV, or JSON. Free HTML table extractor and converter with instant download.
How to Use HTML Table to CSV
Paste HTML or upload
Drop an HTML file or paste the markup directly into the input area. The source can be a saved web page, a copy of view-source from your browser, an HTML email body, or a document export from a reporting tool. The converter doesn't care where the HTML came from as long as it contains <table> elements — anything else in the surrounding markup gets ignored.
Select table (if multiple)
Most real pages contain more than one table — a summary up top, a detailed breakdown below, occasionally a footnote table. The converter lists every table it finds, and you can pick the one you want by its position on the page (first, second, third) or by its id or class attribute when those are present. For Wikipedia data tables specifically, picking by id is much more reliable than positional indexing.
Configure extraction
The configuration handles the cases where simple text extraction isn't enough. Toggle whether the header row should be included as the first CSV row or skipped, choose how to handle cells with rowspan or colspan (duplicate the value across the spanned cells, or leave them empty), and decide whether HTML inside cells should collapse to plain text or preserve link URLs as additional columns.
Download CSV
The converter produces a CSV file with proper RFC 4180 escaping that opens cleanly in Excel, Google Sheets, pandas, or any database import tool. Worth a quick scan of the output before pushing it through your downstream pipeline — merged cells and unusual character encodings are the usual sources of subtle data corruption that's much easier to fix at this stage than after import.
When to Use HTML Table to CSV
Web data extraction
Wikipedia tables, government statistics pages, and company reports often contain exactly the dataset you need but lock it inside HTML markup. Pulling that into a CSV gets it into Excel, pandas, or a database where you can actually work with it. Researchers, data journalists doing competitive analysis, and analysts who need to pull a one-off comparison out of a public site all do this regularly.
HTML email/document tables
Invoices, monthly reports, and data exports often arrive as HTML — either inside an email or as a downloadable HTML file from a reporting system. Spreadsheet software handles those poorly when pasted directly, but a clean CSV opens cleanly. The tool handles the markup-to-CSV step so you can focus on the data rather than fighting Excel's import wizard.
Reporting tool exports
Some legacy reporting tools only export HTML, leaving you to convert it before doing any further analysis. The tool fits naturally into that workflow as the second step — paste the HTML, get CSV, send it to whatever pipeline expects tabular data. Especially useful when integrating older internal tools into modern data pipelines that expect CSV or JSON inputs.
Documentation conversion
Migrating documentation between systems sometimes means turning HTML tables in old docs into CSV for re-import into a new format. The conversion preserves the data structure even when the surrounding markup is being thrown out. Documentation teams running content migrations across tools tend to encounter this exact case.
HTML Table to CSV Examples
Standard table
<table><tr><th>Name</th><th>Age</th></tr><tr><td>Alice</td><td>30</td></tr></table>Name,Age\nAlice,30The minimal case. Header cells (<th>) become the first CSV row, each subsequent <tr> becomes a row of values, and <td> contents become individual cells. Output is comma-separated and newline-delimited, which is what every spreadsheet tool expects by default.
Multi-table page
Page with 3 tablesThree separate CSVs (one per table) by default, or all combined with a separator row if you prefer. Configurable.Most real pages have more than one table — a stats summary, a detailed breakdown, a footnote table. The tool can extract a specific table by index or ID when you only want one, or batch them all when you want to keep them together.
Cells with HTML
<td><a href='example.com'>Alice</a></td>Configurable: just 'Alice' (text only) or 'Alice (link: example.com)' if you want the URL preserved as part of the cell value.Real-world tables often have links, images, or inline formatting in cells. The default behavior strips to plain text so the CSV stays clean, but you can usually opt into preserving link URLs or other metadata as extra columns when that information actually matters for your downstream analysis.
Tips & Best Practices for HTML Table to CSV
- 1.Inspect the table's HTML structure before extracting. Merged cells (rowspan and colspan), nested tables, and missing closing tags all trip up automated tools. A quick look at the source tells you whether you'll need cleanup or whether the conversion will work cleanly.
- 2.Plan for some manual cleanup on complex tables. The tool gives you a solid starting point, but oddly structured tables — especially government data with merged header rows — usually need a human pass before the CSV is genuinely usable.
- 3.Mind the encoding. UTF-8 in, UTF-8 out is the safest path. If the source HTML uses an older encoding (Windows-1252 is still common in legacy reports), you may see garbled accented characters and need to convert encoding upstream.
- 4.Tables embedded in PDFs need a PDF-specific tool first. Extracting the HTML from a PDF (or using a dedicated PDF table extractor) gets you HTML or CSV directly. The HTML table tool only operates on HTML input.
- 5.Check decimal and thousand separators before importing. International datasets often write 1,234.56 as 1.234,56, and the tool generally won't convert between conventions. Spreadsheet software then misreads the numbers as text or interprets them with the wrong locale.
- 6.For repeated extraction, write a script. Manual conversion is fine for a one-off, but if you're pulling the same table weekly, Python with BeautifulSoup and pandas does the same job in fewer keystrokes than even the fastest GUI workflow.
Frequently Asked Questions
Related Tools
CSV to SQL Converter
Convert CSV data into SQL INSERT, CREATE TABLE, or UPDATE statements. Choose database dialect and customize output. Free CSV to SQL tool.
TSV to CSV Converter
Convert between TSV (tab-separated), CSV (comma-separated), and pipe-delimited formats instantly. Free delimiter converter with preview and download.
Text to Table Converter
Convert tab, comma, or pipe-separated text into formatted HTML or Markdown tables. Free text to table converter with live preview.
Oven Temperature Converter
Convert oven temperatures between Fahrenheit, Celsius, and Gas Mark instantly. Free cooking temperature converter with common preset temperatures.
Temperature Converter
Convert between Celsius, Fahrenheit, and Kelvin online. Free temperature converter with instant results and conversion formulas.
Length Converter
Convert between meters, feet, inches, miles, and more length units online. Free length converter with instant accurate results.