Skip to content
gohacks.dev
Web

HTML Table to CSV Converter

Convert an HTML table to CSV, TSV, JSON or a Markdown table, with colspan and rowspan expanded so every row has the same columns.

Free · No sign-up · Your inputs stay in your browser

Input

Convert an HTML table to CSV, JSON or Markdown

Output

Converted

0 characters

colspan and rowspan are expanded by repeating the cell's text into every position it covers, so each row has the same number of columns. The HTML is parsed by the browser into an inert document: no script in it runs and no image loads.

Runs in this browser. Nothing you paste is sent to a server.

Getting a table out of a page

Copying a table from a browser into a spreadsheet often works, but loses structure for spanned cells and drags formatting along. Pasting the page's source here (view-source in the browser, or the element's outer HTML from DevTools) gives clean data. For repeated scraping, pandas' read_html() or a headless browser does the same in code, subject to the site's terms.

CSV quoting

Values that contain the delimiter, a double quote or a newline are wrapped in double quotes and inner quotes are doubled, as RFC 4180 specifies, so Excel and LibreOffice read them back correctly.

Share

Frequently asked questions

What happens to merged cells?
A cell with colspan or rowspan is repeated into every column and row it covers, so the CSV keeps a rectangular shape and lines up with the header.
Can it read several tables from one page?
Yes. Every table in the input is found; choose which one to convert by number.
Is what I paste sent anywhere?
No. The tool runs entirely in your browser with JavaScript. Nothing you type or paste is sent to our server or stored.

Keep planning

Similar tools