HTML Table to CSV

Pull tables out of HTML as CSV, TSV or JSON.

Runs in your browser Instant No sign-up
Format
Delimiter
HTML
Table data

Paste, type or drop a file — output appears as you type.

Waiting for input
Processed locally · nothing is uploadedProcessed locally

How to use the HTML table converter

  1. Paste HTML that contains a <table>: a snippet from a page’s source, an exported report or a whole saved page.
  2. Format: CSV, TSV (best for pasting into Excel or Google Sheets) or JSON.
  3. Table: which table to convert, by number, or all.
  4. Delimiter (CSV): comma or semicolon.
  5. Merged cells (More options): repeat the value, or leave covered cells empty.

Example

The sample has a caption, a <thead>, a rowspan on the seat count and a colspan on the last row:

Plan,Price,Seats
Free,$0,1
Starter,$9,1
"Team, annual",Contact us,Contact us

The status line reads Table 1 of 1 · 4 rows × 3 columns · “Plans”. The seat count 1 spans two rows, so it appears in both. “Contact us” covers two columns, so it fills both. “Team, annual” contains a comma and is quoted.

How rows and cells are read

  • <thead> rows come first and <tfoot> rows last, even if the HTML lists the footer before the body (allowed in older HTML).
  • Cell text is read like a browser shows it: whitespace collapses, <br> becomes a line break inside the field, images contribute their alt text, and scripts are ignored.
  • Rows with fewer cells than the widest row are padded with empty fields.
  • Absurd spans (such as colspan="99999") are capped at 1,000 so a typo can’t build an enormous row.

Getting the HTML

In most browsers, right-click the table and choose Inspect, then right-click the <table> element in the developer tools and pick Copy → Copy outerHTML. Paste that here. Copying the visible table and pasting it as text loses the structure, and merged cells in particular, which is exactly what this tool keeps. Saving the whole page (Save Page As → HTML only) and pasting its source works too: set Table to all to see every table on the page, then pick the one you need by number.

Look at the result as a table in the CSV Viewer, or turn CSV into typed JSON with CSV to JSON. For the whole page rather than its tables, HTML to Markdown converts tables to Markdown along with the text.

Frequently asked questions

How are merged cells (colspan and rowspan) handled?

They are expanded onto a regular grid, so every row has the same number of columns. By default the merged value is repeated in each cell it covers, which keeps filters and sorting meaningful in a spreadsheet. Under More options, Merged cells can leave the covered cells empty instead.

Which row becomes the header?

Rows inside <thead>, or a first row made only of <th> cells. For JSON output the header supplies the keys of each object; duplicate names get _2, _3 suffixes and empty ones become column_1, column_2… If there is no header row, JSON output is an array of arrays.

The page has several tables. Which one is converted?

The first, by default. Type another number in Table (2, 3, …) or all to get every table: CSV separates tables with a blank line, JSON returns one entry per table. Tables nested inside a cell count as separate tables, in document order.

Will it open correctly in Excel?

Choose TSV and paste the result straight into a sheet, or save CSV and open it. Fields with commas, quotes or line breaks are quoted the way Excel expects. In locales that use a comma as the decimal separator, pick the semicolon delimiter.

Is the HTML uploaded?

No. The table is read in your browser, and nothing is sent to a server.

Last updated