HTML table to CSV converter
Paste HTML and extract every table as CSV your spreadsheet can open. Handles multiple tables and messy markup. Nothing is uploaded.
About this converter
A table on a web page holds exactly the data you want and offers no download link. Copy and paste into a spreadsheet works occasionally and mangles the columns the rest of the time, particularly when cells contain line breaks or the page uses nested markup for styling.
This tool takes the markup directly. Open devtools, copy the table element - or just paste the whole page source - and you get clean CSV. It uses a real HTML parser rather than pattern matching, so the sloppy markup that actually exists on the web parses correctly: unclosed cells, inconsistent nesting, attributes in any order, inline elements wrapping the text you want.
Cell text is extracted with nested tags stripped, so a cell containing a link or a span produces the text a reader sees rather than the markup behind it. Whitespace is collapsed by default, which removes the indentation that pretty-printed HTML leaves inside every cell. Turn that off if the spacing inside cells is meaningful.
When the page contains several tables - and pages using tables for layout often contain many - you choose whether to take the first, the largest by row count, or all of them separated by blank lines. Largest is usually the right answer on a page that wraps content in layout tables, because the table you want is almost always the one with the most rows.
Output is RFC 4180 compliant, with quoting applied to any value containing a comma, quote or newline, so it opens cleanly in Excel, Sheets or pandas.
One current limitation worth knowing: cells spanning multiple columns or rows are emitted once, in their starting position, rather than being duplicated across the span. Check the alignment if the source table uses colspan heavily.
The conversion runs in your browser and nothing is uploaded.
Frequently asked questions
- How do I get the HTML?
- Right-click the table, choose Inspect, then right-click the <table> element in devtools and copy the outer HTML. Pasting the entire page source works too.
- The page has several tables. Which one is converted?
- The first by default. Switch to largest if the page uses tables for layout, or to all to extract every one.
- What happens to merged cells?
- A cell using colspan or rowspan appears once at its starting position rather than being repeated across the span, so columns can shift on heavily merged tables.