HTML Table to CSV

Turn one pasted HTML table into CSV text. Pick among top-level tables. Spans leave covered cells empty, and nested tables are refused.

Last updated: October 5, 2026

Tool

This tool will load here.

What this tool does

This html table to csv converter takes pasted HTML and writes one top-level table as CSV text. The parse is DOMParser with text/html. The parsed nodes are not inserted into this page, and the source is not shown as a live table. The output is a textarea of CSV.

Only tables that are not inside another table are offered. If the paste has several of those, the list shows an index and a short preview from the caption or the first row, and you pick one. Tables are not merged. Caption and column-group markup are not cells. Header cells and data cells both become fields, in the row order of table.rows.

Each cell is placed in the next free column. A colspan or rowspan occupies its rectangle. The text is written only in the top-left cell of that rectangle. Every covered position is an empty field. The text is not copied into those positions, because repeating it would invent extra values. If a span overlaps a cell that is already filled, or the span cannot be represented, conversion stops and the previous CSV is cleared.

A cell that contains another table is an error. The inner table is not flattened into the row, and its text is not glued onto the parent. If you need that inner table, paste it as its own top-level table. Cell values are text content, with no extra trimming. Entities are decoded because that is the parser’s text. A link inside a cell contributes the words you can see, not the href.

Quoting matches the JSON to CSV tool. A field that contains a comma, a double quote, or a line break is wrapped in quotes, and a quote inside the field is doubled. Rows are joined with CRLF. Every value stays a string. Numbers are not retyped. A cell that starts with =, +, -, or @ is left unchanged. Spreadsheet software may treat that leading character as a formula. This page does not prefix an apostrophe to “make it safe,” because that would change the data.

How to use

  1. Paste the HTML, including the table.
  2. Choose Convert. If more than one top-level table is present, pick it in the Table list. Enter on that list converts again. Enter in the HTML box starts a new line.
  3. Read the CSV. Copy writes that text. Clear empties the HTML, the CSV, and the table list.

Empty input is an error. HTML with no top-level table is an error. A table with no rows, a nested table, a grid wider than 50 columns, or a grid taller than 500 rows is an error, and the CSV box is cleared so an older result does not stay.

Example

A table whose first row is Name and Qty, and whose second row is Ada and 2, becomes two CSV rows. Those words are text, including the digits. A cell colspan="2" with the text Wide puts Wide in the first column and leaves the next column empty on that row. A rowspan="2" puts the text on the first row only. The cell below it in that column is empty.

A cell whose text is hello, world is quoted. A cell that contains a quotation mark doubles that mark inside the quotes. A line break inside a cell stays inside the quoted field, and the next CSV record still starts after CRLF. =SUM(A1:A2), +123, -123, and @something are copied as those characters. The status says a spreadsheet may treat them as formulas.

Limits

  • One top-level table at a time. Nested tables are refused.
  • Span text is written once. Covered cells are empty.
  • Links contribute visible text, not href.
  • 200,000 characters, 500 rows, 50 columns. Values stay strings.

The CSV is not an HTML preview and it is not a second copy of the page table. When the next step is a JSON array of objects, the JSON to CSV page already reads a header row and keeps every cell a string. This page does not add a header that the HTML did not have. The first row of the table is the first row of the CSV, whether those cells were header cells or data cells.

Copy uses the clipboard when the browser allows it. If it does not, select the CSV and copy it yourself. Clear drops the paste from the page. There is no stored table and no network request.

On this page

Related Articles

Related guides

Related solutions

Need another tool ?

Open the free tools — no signup.

FAQs

newsletter signup

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Innovative Solutions For Modern Needs
Copyright © 2026 Yallasolve. all rights reserved.