How to export an HTML table to CSV
HTML tables look tidy in the browser, but you cannot sort or sum them there. CSV — comma-separated values — is the universal spreadsheet format: plain text, one row per line, columns split by a delimiter. Here is how to get an HTML <table> out as a clean CSV that opens correctly in Excel, Numbers or Google Sheets.
First, is it really a table?
Right-click the data and choose Inspect. If you see a <table> element with <tr> rows and <td> cells, the methods below apply directly. If instead you see a grid of <div> "cards", it is a styled layout, not a table — jump to the extension method, which treats both the same.
Method 1 — Copy, paste, save as CSV
- Select the table on the page and copy it.
- Paste it into an empty spreadsheet.
- Choose File > Save As (or Export) and pick CSV UTF-8.
Simple and reliable for a single, small, well-behaved table. The weak spots: numbers with thousands separators can shift columns, and cells that contain commas or line breaks need proper quoting, which manual paste does not always get right.
Method 2 — A no-code extension (recommended)
The cleanest path is a tool that reads the rendered table and writes a valid CSV for you — quoting fields correctly, keeping UTF-8, and handling cells with commas or newlines. ScrapeSheet does exactly this from your browser.
- Install ScrapeSheet from the Chrome Web Store and pin it.
- Open the page and click the ScrapeSheet icon.
- Click Extract; it detects the table (and any lists) on the page.
- Choose Export to CSV. You can also send it straight to Excel (
.xlsx) or the clipboard.
Because it reads what the browser rendered, it works on tables that arrive via JavaScript and on card layouts that are not real <table> elements. If the table spans several pages, it can follow pagination and infinite scroll and export the lot in one file.
Method 3 — The browser console (for the technical)
If you are comfortable with DevTools, you can select the table and build a CSV string in JavaScript by looping over its rows and cells, joining cell text with commas and rows with newlines, then downloading a Blob. It is quick for a one-off if you already know the DOM, but it is fiddly to get quoting and encoding right, and it breaks whenever the markup changes. For most people the extension is faster and safer.
Avoid the classic CSV headaches
Encoding
Always save as UTF-8. Otherwise accents and symbols (é, ñ, €, £) turn into garbage when the file is opened elsewhere.
The delimiter
"CSV" usually means commas, but some locales (much of Europe) expect a semicolon because the comma is the decimal mark. If Excel dumps everything into one column, open it with Data > From Text/CSV and pick the right delimiter, or switch your file to semicolons.
Quoting
Any cell that contains a comma, a quote, or a line break must be wrapped in double quotes, with internal quotes doubled. A good exporter does this automatically; hand-built CSVs often do not, which silently corrupts rows.
CSV or Excel — which should you export?
- CSV: smallest, most portable, perfect for importing into other tools, databases or Google Sheets.
- Excel (.xlsx): keeps number formats, multiple sheets and types; better if a human will work in it directly.
With ScrapeSheet you can pick either at export time, so you are not locked in. For the full Excel walkthrough, see how to scrape a website to Excel.
FAQ
What is a CSV file?
Comma-separated values: plain text where each line is a row and a delimiter separates columns. Every spreadsheet app reads it.
How do I convert an HTML table to CSV without coding?
Open the page, let ScrapeSheet detect the table, and choose Export to CSV. It handles quoting and encoding for you.
Why does my CSV look wrong in Excel?
Usually encoding or delimiter. Save as UTF-8 and, in some locales, use semicolons — or import via Data > From Text/CSV and choose the delimiter.