HTML to CSV

Extract an HTML table as CSV.

0 chars
0 words
0 lines
0 chars
0 words
0 lines

HTML Table to CSV Converter Online

The HTML to CSV converter extracts a table from HTML markup and saves it as a CSV file. Grab a pricing table, a Wikipedia list, a report generated by a legacy intranet page, or an HTML email, and turn it into data you can open in Excel or import into a database — without retyping a single cell.

How it works

Paste HTML or open an .html file. The parser scans the markup for all <table> elements, including tables nested inside other tables, and numbers them in the order they appear in the source. The selected table is laid out on a grid, converted to CSV, and shown in a preview so you can confirm you picked the right one. If the number is higher than the count of tables, the last table is used.

Real-world HTML is messy — that's fine

  • Merged cells: colspan leaves the extra columns empty; rowspan repeats the value in the rows below, keeping columns aligned.
  • Header detection: rows in <thead> or made entirely of <th> cells become the header in Auto mode. Duplicate or blank header names are made unique.
  • Inline markup: links, bold text, icons, and spans are stripped to their text.
  • Entities: &amp;, &nbsp;, &euro;, and numeric references like &#8364; are decoded.
  • Nested tables: an inner table is extracted as a separate table, and its content is not mixed into the outer cell.
  • Unclosed tags: missing </td> or </tr> tags, which browsers tolerate, are handled too.

CSV options

Pick comma, semicolon, tab, or pipe as delimiter and optionally quote every field. Values containing the delimiter, quotes, or line breaks are quoted automatically either way.

Need another format? Try HTML to JSON, HTML to XML, HTML to YAML, or HTML to TSV. To build an HTML table from CSV, use CSV to HTML.

Frequently Asked Questions

Yes. Paste the full HTML (View Source or “Copy outerHTML” in the browser dev tools). Every <table> element is found; scripts, styles, and comments are ignored. Use the Table number option to choose which table is exported — 1 is the first table in the source.

A cell with colspan keeps its value in the first column and leaves the spanned columns empty, so every row has the same number of fields. A cell with rowspan is copied down into each row it covers, which keeps grouped rows complete when you sort the CSV later.

No — CSV is plain text. Tags like <strong>, <a>, or <span> are removed and only their text is kept, <br> becomes a space, whitespace is collapsed, and entities such as &euro; or &nbsp; are decoded into real characters.

With No header, the first row is treated as data and no header line is written to the CSV. Auto uses the first row as header only if it is inside <thead> or consists of <th> cells; First row always uses it.