HTML Table to CSV Converter

Paste a source containing an HTML <table> tag to convert it into CSV/TSV. Handy when you want to copy a table from another site into a spreadsheet. Header rows inside thead are automatically recognized, and the entire conversion runs in your browser — no data is sent to a server.

How an HTML table row maps to a CSV row

One HTML row <tr><td>name</td><td>age</td><td>city</td></tr>
Resulting CSV notation name,age,city

Rows inside <thead>, or a first row made up only of <th> cells, are recognized as the header row; every other <tr> is converted into one row of CSV.

What Is HTML Table to CSV Converter?

HTML Table to CSV Converter is a tool that turns the source code of a <table> tag embedded in a web page into CSV or TSV data, simply by pasting it in. When you select and copy a table from another site, the clipboard often carries the underlying HTML structure along with the visible text, and you can paste that straight into this tool. Rows inside a <thead> element, or a first row whose cells are all <th>, are automatically recognized as the header row, so there is no need to manually tell the tool whether a header is present.

Even when a cell contains decorative markup such as <strong>, <br>, or <a>, only the tags are stripped away during conversion and the surrounding text content is preserved. You can choose between a comma or a tab as the delimiter, and you can toggle whether the header row is included in the output. If the pasted HTML contains more than one <table> tag, only the first table that appears is used for conversion — the rest are ignored, so it helps to isolate the table you actually want beforehand if a page has several. Every step of the process runs as JavaScript inside your own browser, and the HTML you paste in is never transmitted to any server, which makes the tool safe to use even with data you would rather keep private, such as an internal report or a draft still under review.

How to Use HTML Table to CSV Converter

  1. Paste the HTML source Paste the HTML source that contains the table you want to convert into the input box. If you just want to try it out first, load the built-in example with the "Sample" button.
  2. Choose a delimiter Pick a comma if you plan to import the result into a spreadsheet, or a tab if you want tab-separated text instead.
  3. Decide whether to include the header row Use the "Include header row in output" checkbox to control whether the column names appear as the first line of the result.
  4. Check the conversion result As soon as you paste valid HTML, the CSV or TSV output appears on the right, along with the number of rows that were successfully converted.
  5. Copy or download the result Use the "Copy" button to place the result on your clipboard, or the "Download" button to save it as a file straight away.

Tips for getting more out of it

  • Even without <thead>/<tbody> tags, a first row whose cells are all <th> is automatically recognized as the header row.
  • Decorative tags such as <strong> and <br> inside a cell are automatically stripped, leaving only the text content to be converted into CSV.
  • Selecting and copying a table from another site in your browser often places HTML-formatted data on the clipboard as well, so you can paste it directly into this tool to convert it.
  • This is the reverse of the sister tool, CSV to HTML Table Converter, so using the two together lets you move back and forth between CSV and HTML tables.

Use Cases for HTML Table to CSV Converter

Bringing tables from other sites into a spreadsheet

Copy the HTML of a table from a news article or a statistics page using your browser's developer tools, then convert it directly into a format Excel or Google Sheets can open and sort.

Cleaning up HTML fragments from web scraping

When a script or crawler has captured a page as raw HTML, you can pull out just the table portion and turn it into CSV that is ready for further processing or storage.

Turning tables in a CMS or wiki into structured data

Tables hand-written into a company wiki or blog post as <table> markup can be exported as CSV so they become easy to aggregate, filter, and search.

Reusing tables copied from email or documents

A table pasted from an HTML email or a Word document often keeps its markup on the clipboard, and converting it to CSV makes it far easier to hand off to another tool or spreadsheet.

Going back and forth with CSV to HTML Table Converter

Combine this tool with its reverse counterpart to move freely between CSV and HTML table markup whenever you need to reshape the same data for different destinations.

Glossary for HTML Tables and CSV

thead / tbody
Tags used to divide an HTML table into a header section and a body section. If rows exist inside <thead>, this tool always treats them as the header row regardless of what the first row of the body looks like.
th / td
Tags representing a table cell: <th> is a header cell and <td> is an ordinary data cell. When a table has no <thead>, the tool checks whether every cell in the first row is a <th> to decide whether a header is present.
CSV (Comma-Separated Values)
A plain-text data format in which columns are separated by commas. If a value itself contains a comma, a line break, or a double quote, the entire value is wrapped in double quotes to keep the structure unambiguous.
TSV (Tab-Separated Values)
A format that uses a tab character instead of a comma to separate columns. It tends to leave column boundaries less ambiguous than CSV when the data itself frequently contains commas.
HTML entity
A notation such as &amp; (which represents &) or &nbsp; (a non-breaking space), used to write special characters safely inside HTML markup. This tool automatically decodes entities back into the characters they represent.
Stripping decorative tags
The process of removing markup such as <strong>, <br>, and <a> from inside a cell while keeping only its text content. Attribute values such as a link's URL are discarded and do not appear in the CSV output.

Frequently Asked Questions

Copy the table's HTML using your browser's developer tools (select the element, right-click, and choose "Inspect"), or copy the relevant <table> section from the page's view-source view (e.g. Ctrl+U) and paste it in.

Yes. Even without a <thead> tag, the first <tr> is treated as the header row if all of its cells are <th>. If that's not the case either, every row is converted as-is as a data row.

Only the first <table> tag found is converted. If you want to convert multiple tables, paste and convert each table's HTML separately.

No. The conversion is done entirely in JavaScript running in your browser, and the HTML content you enter is never sent to a server.
Tool-kun

Side Note — Why does a browser's "table copy" include HTML?

When you select and copy a table in your browser, the clipboard ends up holding not just the visible text but HTML-formatted data as well, stored behind the scenes. This works because the OS clipboard supports "multiple formats": the source application writes several representations at once (plain text, HTML, rich text, etc.), and the destination application can pick whichever format suits it best.

This mechanism is why pasting a table from another site directly into Excel or a spreadsheet can reproduce formatting and even links. On the other hand, when the destination is a plain text editor or a CSV file, this underlying HTML information goes unused and the data is treated as plain text, which tends to lose the tabular structure — which cell belongs to which column.

A tool like HTML Table to CSV Converter exists precisely to explicitly restore that easily-lost structural information. By making direct use of the HTML structure carried by a browser's table-copy feature, it lets you reuse the data as correctly column-separated content in a spreadsheet — an unglamorous but reliably in-demand category of everyday practical work.