How to use HTML Table to CSV
- Paste HTML into the HTML box. It can be a single
tableor a whole page. - If the HTML has more than one table, enter the Table number (when there are several). Table 1 is the first one in the code.
- Tick Repeat merged (colspan/rowspan) values in every cell if you want no gaps.
- Leave First row is the header (for JSON keys) ticked to get JSON objects; untick it to get arrays.
- Copy or download the CSV (table.csv) or the JSON (table.json).
What it does and when to use it
Copying a table straight from a web page into a spreadsheet often goes wrong: cells merge, numbers with commas split into two columns, or the whole row lands in one cell. Working from the HTML avoids that. The tool reads the real rows and cells, so the CSV has exactly one line per table row and every value stays in its own column.
Use it for tables in reports, documentation pages, exported web pages or old HTML emails, and for feeding table data into a script as JSON. To turn the CSV into a table for a README, use CSV to Markdown. To go the other way and build a table from rows of text, use the HTML Table Generator.
How it works
The HTML is parsed in your browser and each table is turned into a grid. Header cells (th) and data cells (td) are treated the same. A cell with colspan="2" takes two positions in its row, and a rowspan cell reserves its position in the rows below, so later cells land in the right column. Each cell’s text is then CSV-escaped and the rows are joined with Windows line endings (CRLF), which every spreadsheet accepts.
For JSON, the first row supplies the keys. An empty header cell becomes column1, column2 and so on.
Worked examples
The sample sales table. It has a comma in “North, East”, thousands separators, a colspan="2" cell and a name with quotes. The CSV is:
Region,Q1,Q2
"North, East","1,200","1,450"
South,Not reported,
"West ""Coast""",980,"1,105"
Repeating merged values. With the repeat option ticked, the South row becomes South,Not reported,Not reported, and its JSON object gets "Q2": "Not reported" instead of an empty string.
Picking the second table. HTML with a people table and a second table captioned “Pets”, with Table number set to 2, gives the CSV Pet / Cat and the note Found 2 tables; showing table 2 (“Pets”).
Limits and tips
- A table nested inside another table counts as a separate table.
- Numbers stay text exactly as written, including currency signs and separators, so
1,200is not changed to1200. - If the table is built by JavaScript, the page source may not contain it. Copy the rendered HTML from the developer tools instead.
- To clean the table’s markup before converting, run it through the HTML Cleaner.
Frequently asked questions
How do I get a table from a website into this tool?
Why are some values wrapped in double quotes?
What happens to merged cells?
Are links and formatting kept?
Why does Excel show odd characters for € or accents?
How do we know nothing is uploaded? Test it yourself on the privacy proof page.