Convert an HTML table to CSV
Extract a table from a web page or an HTML file as CSV.
- Nothing is uploaded
- Free · no account
- Tested on 400k-row files
Reference
HTML Table to CSV: how it works
The tool is above. Below: a short overview, optional step-by-step detail, honest browser limits, and answers to common questions.
Last updated 2 min read
About this tool
PrivateCSV converts HTML tables to CSV. Copy a table from any web page and paste it here, or open a saved .html file: every table is found and you pick the one you need. Merged cells (colspan and rowspan) are expanded so the columns stay aligned, line breaks inside cells are kept, links and images become their text, and hidden elements are skipped. The page is parsed by your own browser, so nothing is uploaded.
Read the step-by-step guideHow-to, example and use cases (~2 min)
How to convert an HTML table to CSV
- On the web page, select the table with the mouse and copy it (Ctrl+C, or Cmd+C on a Mac).
- Click Paste HTML data above and paste: the table's HTML is kept, not only its text. You can also drop a saved .html file.
- If several tables are found, choose one in the Table menu and check the preview.
- Click Convert to CSV and download the file.
Example
A table with a merged header cell.
<table>
<tr><th rowspan="2">Store</th><th colspan="2">Hours</th></tr>
<tr><th>Opens</th><th>Closes</th></tr>
<tr><td>Madrid</td><td>09:00</td><td>20:00</td></tr>
</table>Store,Hours,
,Opens,Closes
Madrid,09:00,20:00When you need it
- Tables on Wikipedia and other websites
- Statistics, rankings, schedules and price lists are often published as HTML tables. Copy one and get a CSV for Excel, Google Sheets or Python.
- Reports exported as HTML
- Some accounting, monitoring and analytics tools export reports as HTML files. Open the file here to get the table as data.
- Emails and saved pages
- Save the page or the email as .html, then extract the table you need without retyping it.
Merged cells and layout
A cell spanning several columns or rows (colspan, rowspan) keeps its text in its first position and leaves the other positions empty, so every row has the same number of columns and values stay under the right header. Header rows from <thead> come first and footer rows from <tfoot> last, whatever their order in the HTML. Tables nested inside a cell are listed separately.
Cell text is read as it displays: whitespace is collapsed, <br> and paragraphs become line breaks inside the cell, images give their alt text, and hidden elements, scripts and styles are ignored.
Browser and file limits (not a trial)
These are technical limits of running in your browser—device memory, encoding and what this tool does not do. They are not a free trial, account quota or paid plan. There is no subscription.
- Tables drawn with <div> elements and CSS (common on modern sites) are not real tables and cannot be detected.
- Links keep their text, not their URL.
- Pages that build their tables with JavaScript after loading must be copied from the browser, not saved as source.
Frequently asked questions
How do I convert an HTML table to CSV?
Copy the table from the web page, click Paste HTML data above and paste, or open the .html file. Pick the table if there are several and click Convert to CSV.
How do I copy a table from a website into Excel?
Pasting directly into Excel often merges cells or brings formatting along. Paste the table here instead, convert it to CSV, and open the clean CSV in Excel. Or, in Excel, use Data > From Web with the page address.
How do I extract a table from Wikipedia?
Select the table on the Wikipedia page, copy it, and paste it here with Paste HTML data. Footnote markers like [1] stay in the cells as text.
Can I convert HTML tables with Python?
pandas.read_html("page.html") returns a list of DataFrames, one per table, and DataFrame.to_csv writes each. It needs lxml or html5lib installed. This page does the same without code.
Related tools
Go further
Your files never leave your device
PrivateCSV runs this tool in your browser. No upload, no account, no trial and nothing to install.