Toolvore

HTML Table to CSV

Convert selected HTML tables to CSV with merged-cell options, entity decoding and formula protection.

This tool runs entirely in your browser. Your data is never uploaded, never stored, and never leaves your device.

Convert a chosen HTML table to CSV locally, with explicit merged-cell handling, decoded text and spreadsheet-formula protection.

How to use it

  1. 1Paste HTML or load a UTF-8 HTML file up to 1 MiB.
  2. 2Inspect tables and choose the table, merged-cell policy and delimiter.
  3. 3Convert, review the text-only preview and download CSV.

Example

Input
<table><tr><th>Name</th><th>Qty</th></tr><tr><td rowspan="2">Tea &amp; coffee</td><td>2</td></tr><tr><td>3</td></tr></table>
Output
Name,Qty Tea & coffee,2 ,3

Keep text once leaves the second covered position blank.

What happens to your data

Source markup is parsed as data without creating a browser document or fetching its resources. Source and CSV contents stay in browser memory.

Last updated October 2026

Extract one HTML table into a CSV file without opening the supplied markup as a webpage. Paste source or load a UTF-8 HTML file, inspect the detected top-level tables, then choose exactly which table to export. The text-only preview helps you check rows before downloading.

Merged cells need an explicit decision: keep their text once and leave covered positions blank, or repeat the text across every covered position. Entity decoding, CSV quoting and optional spreadsheet-formula protection are applied locally. No remote page is fetched and source scripts, images or frames are never rendered by this tool.

How it works

Paste HTML containing a table element or load a local UTF-8 .html file. Select Inspect HTML tables to parse the source as data using parse5. The parser does not create a browser document, run scripts or request image, frame, stylesheet or link URLs from the input. Table captions or IDs identify the choices; only the selected top-level table is exported. Tables inside script, style, template, noscript, iframe, object, SVG or MathML content are excluded. A selected table containing a nested table is rejected: copy the desired inner table separately instead of silently mixing independent grids.

Rows follow parsed source order across thead, tbody and tfoot groups. Every td or th cell is retained as text; the first row is not inferred as a header or discarded. HTML character references such as &amp; and &quot; are decoded. Inline tag text is joined, ordinary HTML whitespace collapses, br creates a newline, and common block elements create line boundaries. Repeated excess line boundaries are reduced. CSS is not computed, so hidden source text can remain in the export. Links contribute their text, not their URL; images and form-control values are not extracted. Scripts, styles, embedded documents and the other excluded element types contribute no text. This is a defined source-text conversion, not a pixel-perfect copy of a rendered page.

Colspan and rowspan must be explicit positive decimal integers from 1 to 100. Rowspan zero, spans extending beyond their row group, overlapping merged cells and expanded grids beyond the limits stop conversion with an error. Keep text once places a merged cell's value only in its upper-left position. Repeat text fills each covered position with that value. Shorter unmerged rows are padded with blank cells to make rectangular CSV; the result reports the number of these padded blanks and merged cells so this structural change is visible.

Choose comma, semicolon or tab as the delimiter. Fields containing the delimiter, quotes or line breaks are quoted, and embedded quotes are doubled. Downloads are UTF-8 without a BOM, with CRLF record endings and a final record ending. Semicolon and tab options use the same escaping convention as comma CSV. The preview is limited to eight rows and six columns and abbreviates long cell text; the full download contains every supported row and column of the selected table.

Spreadsheet-formula protection is on by default. It prefixes an apostrophe to cell text beginning, after ASCII spacing or line breaks, with =, +, − as the ASCII hyphen, or @. This changes text, including some negative numbers. Disable it when preserving that text is necessary and you trust the receiving application. It is a mitigation rather than a guarantee across every spreadsheet application. Import identifier columns as text to avoid a spreadsheet removing leading zeros or changing dates.

Input is limited to 1 MiB of UTF-8, 50,000 parsed nodes, 100 nesting levels and 50 top-level tables. The selected table supports up to 2,000 rows, 100 expanded columns and 50,000 expanded cells, with an 8 MiB output cap. Invalid UTF-8, NUL characters and unpaired Unicode surrogates are rejected. HTML parsing follows normal HTML repair rules; this is not a strict HTML syntax validator. Review the preview when malformed markup may have changed the grid.

For example, Name/Qty headers and a Tea &amp; coffee cell spanning two data rows export as Name,Qty then Tea & coffee,2 then ,3 using the keep-once policy. Repeat text would put Tea & coffee in both data rows. No value is inferred as a number or date.

Editing the source, loading another file or changing a table or output option clears the old result. Late reads and parser imports cannot overwrite newer edits. The tool processes source and results in browser memory and does not submit their contents. Exported CSV may contain confidential information; review it before sharing.

Worked example: Make a rowspan policy explicit

Input
<table><tr><th>Name</th><th>Qty</th></tr><tr><td rowspan="2">Tea &amp; coffee</td><td>2</td></tr><tr><td>3</td></tr></table> Merged cells: keep text once
Result
Name,Qty Tea & coffee,2 ,3

Repeat text would place Tea & coffee in both data rows. The header is retained as the first CSV row.

Common use cases

  • Converting a saved report table into reviewable CSV
  • Choosing one table from a document containing several grids
  • Making merged headings explicit before a spreadsheet import
  • Extracting text from table markup without executing embedded resources

Frequently asked questions

Can I paste a webpage URL?+

No. Paste table markup or load a local UTF-8 HTML file. The tool does not fetch remote pages, log in to sites, render JavaScript tables or scrape screenshots.

What happens to merged cells?+

Choose text once with covered cells blank, or repeat text across every covered position. Invalid or overlapping spans are rejected. Short rows are padded, and the number of padded blanks is shown.

Will source scripts or images run?+

No. Source HTML is parsed as a data tree, not inserted into a browser document. Scripts are not executed and resource URLs are not loaded by this conversion.

Does the CSV exactly match what the page looks like?+

No. CSS visibility and layout are not computed. Text normalization, merged-cell handling and optional formula protection can change the representation. Images, link targets, styles and form values are not exported.

Why does an exported cell start with an apostrophe?+

Default formula protection changes formula-like values, including some negative numbers, by adding an apostrophe. Disable the option if exact source text is required and you trust how the CSV will be opened.

Are nested tables supported?+

A selected table containing another table is rejected to avoid silently flattening two grids into one. Copy the intended inner table as standalone markup first.