UTILS.
100% in-browser
⊞c

HTML / Markdown Table to CSV / JSON

Paste an HTML <table> or a Markdown table and extract it to CSV or JSON.

output

About this tool

HTML / Markdown Table to CSV is a free, in-browser tool that goes the opposite way from a table generator: paste the source of an HTML <table> element or a GitHub-Flavored-Markdown pipe table and it extracts the rows and cells into CSV or a JSON array of objects. HTML is parsed with the browser's own detached DOMParser so tags, nested markup and entities are handled correctly; Markdown tables are split on pipe characters with the header-separator line (the --- row) skipped automatically.

Everything runs locally in your browser using JavaScript — nothing is uploaded or stored. This is the reverse of our CSV/JSON to HTML table and to Markdown table generators, which build tables from data; this tool ingests an existing table and gives you back the data. The input type is auto-detected, and the CSV delimiter, header handling and output format update the result live.

Frequently asked questions

How is this different from the HTML/Markdown table generators?
The table generators take rows of data and produce an HTML <table> or a Markdown table for you to paste elsewhere. This tool is the reverse: it takes an existing HTML or Markdown table and extracts the underlying data back out as CSV or JSON.
How does it decide between HTML and Markdown?
If the input contains table tags such as <table>, <tr> or <td>, or begins with a '<', it is parsed as HTML with a detached DOMParser; otherwise lines containing pipe characters are parsed as a Markdown table and the --- separator row is ignored.
What does the JSON output look like?
It is an array of objects, one per body row, keyed by the header cells when 'first row is a header' is on (otherwise keys are col1, col2, …). Ragged rows are padded with empty strings so every object has the same keys.
What CSV conventions does the output follow?
Cells are joined with the chosen delimiter (comma, semicolon, tab or pipe), and any cell containing the delimiter, a quote or a newline is wrapped in double quotes with inner quotes doubled, so the CSV round-trips cleanly.

More tools