Convert HTML Table to CSV Online
Export an HTML table to CSV for Excel, Google Sheets or a database import. The markup is read in your browser and never uploaded.
Drop a CSV or Excel file here
CSV · XLSX · XLS · XLSM · XLSB
Ready to download as a binary file.
How to convert an HTML table to CSV
Three steps from report.html to CSV.
1. Paste the HTML
Paste markup that contains a <table>, or drop an .html file.
2. Check it in the grid
Look for empty columns or shifted values caused by colspan or rowspan, and delete rows that are only there for layout.
3. Choose a delimiter
Comma, semicolon, tab or pipe. The text updates as you switch; copy it or download data.csv.
Example: HTML in, CSV out
A sales report with thousands separators and a row that spans all columns (colspan="3").
<table>
<tr><th>Region</th><th>Q1</th><th>Q2</th></tr>
<tr><td>North</td><td>1,200</td><td>1,350</td></tr>
<tr><td colspan="3">South: no data yet</td></tr>
</table>Region,Q1,Q2
North,"1,200","1,350"
South: no data yet,,The colspan row arrives as a single cell, so "South: no data yet" sits under Region and its Q1 and Q2 fields are empty. Values with commas, such as 1,200, are quoted.
What changes between HTML and CSV
Quoting
A value is put in double quotes only when it contains the delimiter, a double quote or a line break, and inner quotes are doubled. Here the value 1,200 is written as "1,200".
Delimiter
Comma is the default. Semicolon is what Excel expects in locales that use a decimal comma (Germany, France, Brazil and others); Tab gives a TSV that pastes cleanly into spreadsheets; Pipe is handy when the data is full of commas.
Text content only
Each cell's text is taken, trimmed. Tags inside cells, such as links or <b>, are dropped and entities are decoded.
When to convert HTML to CSV
- Getting a table from a web page into a spreadsheet.
- Converting HTML reports from an old system into CSV for import.
HTML to CSV in JavaScript
TabularJS reads HTML: every <table> becomes a worksheet. Then each field is quoted only where CSV needs it.
import tabularjs from 'tabularjs';
// The first row of the table becomes the column titles
const { worksheets } = await tabularjs('report.html', { tableIndex: 0 });
const header = worksheets[0].columns.map((col) => col.title);
const rows = worksheets[0].data;
const field = (v) => {
const s = String(v ?? '');
return /[",\n]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
};
console.log([header, ...rows].map((row) => row.map(field).join(',')).join('\n'));TabularJS differs from this page in two ways: it returns every <table> as a worksheet, and it turns colspan into mergeCells.
Frequently asked questions
Why not paste the table straight into Excel?
That often works, but it brings formatting, merged cells and hidden characters along. This page takes the text only and gives you a plain CSV.
Why are some fields at the end of a row empty?
That row had fewer cells than the header, usually because of colspan. The CSV keeps the column count, so the missing cells are written as empty fields.
Are links and images kept?
No. Only the visible text of each cell is read, so a link keeps its text and loses its URL, and images are dropped.
Can I export a TSV file?
Yes. Pick Tab as the delimiter. The download is still named data.csv, so rename it to .tsv if your tool expects that extension.
Does report.html get uploaded when I convert it to CSV?
No. The markup is read in your browser and never uploaded.