DevTools Logo

HTML Table to CSV Converter

HTML Table to CSV

Extract every table from pasted HTML — colspan, rowspan, headers and entities handled.

Runs in your browser
Try an example

HTML markup

Paste markup from a saved page or a rich-text copy of a rendered table. The scanner finds every table (including nested ones), resolves colspan and rowspan into a dense grid, detects header rows from th cells, decodes entities and converts <br> to newlines inside quoted CSV fields. Choose comma, semicolon or tab output, export all tables or one by caption, and review notices about malformed or unusual markup. Parsing happens locally.

  • Header detection — The th row becomes the CSV header; the following row becomes data.
  • Spanned cells — The colspan is expanded to two aligned CSV columns.
  • Line breaks in cells — The break is preserved as a newline inside a quoted CSV field.

CSV output

No CSV yet

Paste HTML containing a <table> element or load an example.

Examples

Header detection

Input
<table><tr><th>Name</th><th>Role</th></tr><tr><td>Ada</td><td>Dev</td></tr></table>

The th row becomes the CSV header; the following row becomes data.

Spanned cells

Input
<table><tr><td colspan="2">Group</td></tr><tr><td>a</td><td>b</td></tr></table>

The colspan is expanded to two aligned CSV columns.

Line breaks in cells

Input
<td>Zoë<br>Junior</td>

The break is preserved as a newline inside a quoted CSV field.

About this tool

Paste markup from a saved page or a rich-text copy of a rendered table. The scanner finds every table (including nested ones), resolves colspan and rowspan into a dense grid, detects header rows from th cells, decodes entities and converts <br> to newlines inside quoted CSV fields. Choose comma, semicolon or tab output, export all tables or one by caption, and review notices about malformed or unusual markup. Parsing happens locally.

What this tool does not do

  • Processes only the inputs provided in this session without connecting to external accounts or background servers.
  • Runs entirely in the current browser tab; nothing is synced across devices or backed up to a server.

How to use this tool

  1. Paste HTML or upload .html

    Paste outerHTML containing one or more <table> elements.

  2. Pick table index and delimiter

    Select which detected table to extract and choose comma, tab, or semicolon output.

  3. Copy or download CSV

    Verify expanded colspan/rowspan alignment and download the RFC 4180 CSV.

Use cases

Header detection

The th row becomes the CSV header; the following row becomes data.

Spanned cells

The colspan is expanded to two aligned CSV columns.

Line breaks in cells

The break is preserved as a newline inside a quoted CSV field.

Common mistakes

Mistake:What if my pasted HTML page contains multiple <table> elements?

Fix:Every detected table is indexed with its row/column dimensions so you can preview and export whichever table you need.

Mistake:Can this tool fetch a live webpage URL directly?

Fix:No—to avoid CORS failures and server proxying, copy the table or page source from DevTools ('Copy outerHTML') and paste or upload the .html file locally.

Frequently asked questions

How are colspan and rowspan cells converted to CSV?

Merged HTML cells are expanded onto a normalized 2D grid so subsequent columns stay aligned under their true headers instead of shifting left.

What if my pasted HTML page contains multiple <table> elements?

Every detected table is indexed with its row/column dimensions so you can preview and export whichever table you need.

Can this tool fetch a live webpage URL directly?

No—to avoid CORS failures and server proxying, copy the table or page source from DevTools ('Copy outerHTML') and paste or upload the .html file locally.

How are commas, quotes, and line breaks inside cells escaped?

Cells containing your chosen delimiter, double quotes, or newlines are wrapped in RFC 4180 double quotes with internal quotes doubled.