DuckyTools
Home Convert HTML Table to CSV

HTML Table to CSV Convert

Paste an HTML table and get clean CSV, Markdown or JSON out of it.

HTML Table to CSV is a free online tool that paste an HTML table and get clean CSV, Markdown or JSON out of it. It produces cSV, TSV, Markdown table, JSON objects.. It runs entirely in your web browser using DOMParser, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free — no account, no quota, no watermark
Category
Convert
Where it runs
In your browser, on your device
Files uploaded
None
Output
CSV, TSV, Markdown table, JSON objects
Technology
DOMParser
Settings
3
Works offline
Yes, after the first visit

About HTML Table to CSV

This parses the HTML with the browser’s own parser rather than with regular expressions, which is why it copes with the markup real pages produce — unclosed cells, nested tags, attributes in any order, whitespace scattered anywhere. Cell text is collapsed to single spaces, because in HTML the whitespace between tags is layout rather than data. Where a page has several tables you can pick which one by number, and the error tells you how many there are.

How to use it

  1. Paste the text you want to run through html table to csv.
  2. Set output as, table number (1 = first) and first row is a header.

The 3 settings

SettingWhat it doesDefault
Output asChoose from 4: CSV, TSV, Markdown table, JSON objects.CSV
Table number (1 = first)Range 1–50.1
First row is a headerOn or off. On by default.On

Under the hood

Runs onDOMParser — parses the markup
ProducesCSV, TSV, Markdown table, JSON objects
ControlsOutput as, Table number (1 = first), First row is a header

Questions

Where do I get the HTML from?

Right-click the table, choose Inspect, then copy the outer HTML of the `<table>` element. Copying the whole page source works too — the tool finds the tables in it either way.

What happens to merged cells?

Cells with `colspan` or `rowspan` are read once, in the position where they appear, so a table using them will come out misaligned. That is inherent — CSV has no concept of a merged cell — and a table with merged headers usually needs a manual tidy afterwards.

Why are quotes and commas handled oddly in the CSV?

They are handled correctly, per RFC 4180: a value containing a comma, a quote or a line break is wrapped in double quotes, and quotes inside it are doubled. That is what spreadsheets expect, even though it looks strange on screen.