HTML Table to CSV Converter

Paste a source containing an HTML `

` tag to convert it into CSV/TSV. Handy when you want to copy a table from another site into a spreadsheet. Header rows inside thead are automatically recognized, and the entire conversion runs in your browser — no data is sent to a server.

How an HTML table row maps to a CSV row

One HTML row <tr><td>name</td><td>age</td><td>city</td></tr>
Resulting CSV notation name,age,city

Rows inside ``, or a first row made up only of `` cells, are recognized as the header row; every other `` is converted into one row of CSV.

Tips

  • Even without ``/`` tags, a first row whose cells are all `` is automatically recognized as the header row.
  • Decorative tags such as `` and `
    ` inside a cell are automatically stripped, leaving only the text content to be converted into CSV.
  • Selecting and copying a table from another site in your browser often places HTML-formatted data on the clipboard as well, so you can paste it directly into this tool to convert it.
  • This is the reverse of the sister tool, CSV to HTML Table Converter, so using the two together lets you move back and forth between CSV and HTML tables.

Frequently Asked Questions

Copy the table's HTML using your browser's developer tools (select the element, right-click, and choose "Inspect"), or copy the relevant `` section from the page's view-source view (e.g. Ctrl+U) and paste it in.

Yes. Even without a `
` tag, the first `` is treated as the header row if all of its cells are `
`. If that's not the case either, every row is converted as-is as a data row.

Only the first `` tag found is converted. If you want to convert multiple tables, paste and convert each table's HTML separately.

No. The conversion is done entirely in JavaScript running in your browser, and the HTML content you enter is never sent to a server.
ツールくん

Side Note — Why does a browser's "table copy" include HTML?

When you select and copy a table in your browser, the clipboard ends up holding not just the visible text but HTML-formatted data as well, stored behind the scenes. This works because the OS clipboard supports "multiple formats": the source application writes several representations at once (plain text, HTML, rich text, etc.), and the destination application can pick whichever format suits it best.

This mechanism is why pasting a table from another site directly into Excel or a spreadsheet can reproduce formatting and even links. On the other hand, when the destination is a plain text editor or a CSV file, this underlying HTML information goes unused and the data is treated as plain text, which tends to lose the tabular structure — which cell belongs to which column.

A tool like HTML Table to CSV Converter exists precisely to explicitly restore that easily-lost structural information. By making direct use of the HTML structure carried by a browser's table-copy feature, it lets you reuse the data as correctly column-separated content in a spreadsheet — an unglamorous but reliably in-demand category of everyday practical work.