HTML Table ⇄ CSV
Convert an HTML table into CSV, or turn CSV into a clean HTML table. Includes a rendered preview and a header row toggle. Runs in your browser.
Paste the HTML of a table and get CSV you can open in a spreadsheet, or paste CSV and get table markup you can drop into a page. A rendered preview shows what the markup produces, and the first row can be treated as a header.
Paste an HTML table...
// HTML Table ⇄ CSV: Features
Getting a table off a web page
Copying a rendered table and pasting it into a spreadsheet often works badly: merged cells collapse, formatting comes along, and hidden columns appear. Taking the markup instead is more reliable. Open your browser developer tools, find the table element, copy its outer HTML, and paste it here. What comes back is plain CSV with the cell contents and nothing else.
Generating markup from data
The other direction turns a CSV export into a table you can paste into a page, a wiki or an email template. With the header option enabled the first row becomes a proper thead with th cells, which matters for accessibility: screen readers use the header row to announce which column a value belongs to, and a table built entirely from td cells gives them nothing to work with.
The markup is sanitised before preview
The preview renders the table so you can see the result rather than reading markup, and the HTML is stripped of anything executable before it is displayed. That is necessary because the input is frequently copied from a page you do not control. It also means the preview shows structure rather than the original page's styling, which is usually what you want when checking that the rows and columns came out right.
What does not survive the conversion
CSV is a flat grid, so anything a table expresses beyond rows and columns is lost. Cells spanning several columns or rows are the main casualty: the value appears once and the grid no longer lines up the way it looked. Nested tables, links, images and formatting all reduce to their text. Check the row and column alignment of the output whenever the source table used spans.
Tables containing customer data stay local
Parsing, conversion and preview all run in your browser, so nothing you paste is transmitted, stored or logged. Tables from internal dashboards, reports containing customer data and extracts from a system you are debugging can all be converted here. For CSV that needs a different delimiter, the CSV converter handles semicolons and tabs as well.
// HTML Table ⇄ CSV: FAQ
How do I get the HTML of a table on a page?
- Right-click the table, choose inspect, find the enclosing table element in the developer tools, then copy its outer HTML. Paste that here. This is more reliable than copying the rendered table, which tends to bring formatting and hidden content with it.
What happens to merged cells?
- They cannot be represented in CSV, so a cell spanning several columns or rows contributes its value once and the surrounding grid no longer matches the visual layout. If the source table uses spans, check the alignment of the output before relying on it.
Does it keep links and formatting?
- No. CSV holds text, so a cell containing a link contributes the link text and the destination is dropped, and bold or coloured text becomes plain. If the destinations matter, extract them separately before converting.
What does the header option do?
- When converting CSV to HTML, it puts the first row in a thead with th cells instead of ordinary td cells. That is the accessible form, because assistive technology uses the header row to describe what each value means. Turn it off only when your data genuinely has no header.
Is the preview safe with markup from an unknown page?
- The markup is sanitised before being rendered, with scripts and event handlers removed, so pasting a table copied from a page you do not control does not execute anything. The preview shows structure rather than the original styling.
Can I open the result directly in Excel or Google Sheets?
- Yes. Save the CSV output as a .csv file and open it, or paste the text straight into a sheet and use its text-to-columns feature with comma as the separator. If your locale's spreadsheet expects semicolons, the CSV converter can produce that instead.
Why does my HTML input report that no table was found?
- Because the markup you pasted does not contain a table element. Copying an inner part such as a tbody, or copying a grid built from div elements with CSS rather than a real table, both produce this. A CSS grid has no table structure to extract, and needs a different approach.
Does it handle multiple tables in one input?
- The first table in the markup is converted. Paste one table at a time if your source contains several, which also makes it easier to confirm you extracted the one you meant.
Are non-Latin characters handled?
- Yes. Cell contents are treated as text regardless of script, so Japanese, Chinese, Cyrillic and accented characters all convert. If a spreadsheet later shows them incorrectly, the cause is the file encoding it assumed rather than the conversion; saving as UTF-8 and importing explicitly resolves it.
Is the table or CSV I paste sent to a server?
- No. Parsing, conversion and preview all happen in your browser, and closing the tab discards whatever you pasted.
// How to Use HTML Table ⇄ CSV
-
HTML to CSV, or CSV to HTML
Select HTML to CSV to extract a table, or CSV to HTML to generate markup. Press SAMPLE to see the expected input shape for the current direction.
-
Paste the table markup or the CSV
For HTML, paste markup containing a table element, copied from your browser developer tools. For CSV, paste the rows, and decide whether the first one should become a header.
-
Check the preview, then copy
The rendered preview shows how the table actually comes out, which is the quickest way to spot a column that has shifted because of a merged cell. Copy the output when it looks right.
Category Utilities