HTML to CSV Converter

Turn one table or every table on a page into CSV, with merged cells filled in properly.

HTML
CSV
Runs locally in your browser

About the HTML to CSV Converter

A table copied from a report or a wiki almost never has a rectangular grid behind it. Header cells span two columns, a total row spans three, and a category label spans four rows down the left edge. Naive extraction shifts every value after the first merge and the spreadsheet ends up nonsense. This converter builds a coordinate grid first, places each cell at its true row and column, then repeats a merged value across the cells it covers so every output row has the same width.

Set the table number to pick one table from a page that holds several, or set it to zero to export all of them, separated by a blank line. Four delimiters are available, and semicolon is the one to choose when the sheet will open in a European Excel locale where the comma is a decimal separator. Untick expansion if you would rather see a merged value once with blanks beside it, which is closer to how the original looks.

Cell text is normalised before it is written: newlines and tabs inside a cell become single spaces, non-breaking spaces become ordinary ones, and leading or trailing whitespace goes. Quoting follows RFC 4180, so any field holding the delimiter, a quote character or a line break is wrapped and internal quotes are doubled. Turn on quote every field for importers that need it. From here the CSV to JSON and CSV to Excel tools take the result further.

How to use

  1. Paste the table markup, or copy an element in the browser inspector with Copy outerHTML and paste that.
  2. Set Table number to the table you want, or 0 for all of them.
  3. Pick a delimiter and download the .csv file.

Common questions

How are colspan and rowspan handled?
A merged cell is placed at its real coordinates and its text is repeated across every cell it covers, so each row ends up with the same number of fields.
The page has five tables. How do I get the third?
Type 3 in the table number box. Tables are numbered in document order, and 0 exports every one of them.
Why does my spreadsheet put a whole row in one cell?
Excel in a European locale expects semicolons. Switch the delimiter to semicolon and reopen the file.
Does it read tables built from div elements?
No. The converter looks for real table, tr, th and td elements. Grid layouts made from divs have no row structure to read.