HTML Table to TSV Converter
CV-61Paste HTML that contains a table and get tab-separated rows you can paste straight into a spreadsheet. You can take one table or all of them.
Runs in your browser. Nothing is uploaded.
HTML containing a table
TSV
How to use it
- Paste the HTML into the input box. A full page or just the table markup both work.
- Choose All tables or a single table number.
- Leave Add empty cells for colspan on so the columns line up.
- Copy the TSV or download it as a .tsv file.
How tables and cells are read
Every table that is not nested inside another table is found. With All tables, they are written one after another with a blank line between. Cell text is the text inside each td or th, with all whitespace collapsed to single spaces, so line breaks, images and alt text do not appear and entities such as & are decoded. The table caption is not included. Thead, tbody and tfoot rows are written in the order they appear.
Colspan, rowspan and nested tables
A cell with colspan is followed by empty cells so the columns stay aligned. Rowspan is not expanded, so a row under a rowspan cell is shorter. Every row is then padded on the right with empty cells to the width of the widest row, which keeps the output rectangular. A nested table is not output on its own: its text becomes part of the cell that contains it.
Quoting in the output
Because whitespace is collapsed, cells never contain tabs or line breaks. A value that starts with a double quote is wrapped in quotes with its inner quotes doubled, so spreadsheet programs read it as text and not as the start of a quoted field. The first row is not treated specially: header cells and data cells come out the same way.
Error messages and what to do
| Message | What it means | Fix |
|---|---|---|
No <table> found in the HTML. | The input has no table element. | Paste HTML that contains <table>, <tr> and <td> or <th> tags. |
A <table> has no <tr> rows. | A table was found but it holds no rows. | Check that the table markup is complete, or pick another table. |
Questions people ask
How do I convert an HTML table to TSV?
Paste the HTML and the TSV appears at once. Copy it and paste it into Excel or Google Sheets, where the tabs place each value in its own column. You can also download it as a .tsv file.
What if my page has several tables?
Leave All tables on to get every table separated by a blank line, or choose table 1 to 5 to take one. If you pick a number that is higher than the number of tables, you get a message that says how many were found.
How does colspan work?
A cell that spans three columns is written once, followed by two empty cells, so the columns below it still line up. You can turn this off if you want the cell written only once.
Why is some text missing from a cell?
Only text is read. Images, alt text and the content of script and style tags are not included. Line breaks inside a cell become spaces.
Can I use it on a page copied from a website?
Yes. Paste the page source or the part with the table. The tool reads it with its own tokenizer, so it does not need to load the page and it ignores scripts.
About this tool
Reads the HTML with a built-in tokenizer, so it works on a fragment or a whole page and does not need a browser. Every table that is not inside another table is found; All tables writes them one after another with a blank line between, or you can pick table 1 to 5. A nested table is not output on its own: its text becomes part of the cell that holds it. Cell text is the text inside the td or th with whitespace collapsed to single spaces, so line breaks, images and alt text do not appear. Entities such as & are decoded. A cell with colspan is followed by empty cells so the columns line up (option). rowspan is not expanded, so rows below a rowspan cell come out shorter and are padded on the right with empty cells to the width of the widest row. The caption is not included. A value that starts with a double quote is wrapped in quotes with the inner quotes doubled.