convert-csv.com logo convert-csv.com

Convert HTML Table to CSV / Excel

Paste an HTML table and convert it to CSV or Excel, preserving rows and columns.

100% Secure - your files are processed in your browser and never sent to a server.
Drop your file hereor click to browseSupports HTML or TXT files (.html, .htm, .txt) (Max 100MB)

HTML tables are one of the most common ways to display structured data on web pages, but they are difficult to export or manipulate outside the browser. This tool converts HTML <table> elements into clean CSV or Excel format, preserving the row and column structure. It parses the header row (<thead> or the first <tr>), data rows (<tbody>), and handles merged cells (colspan and rowspan) by filling appropriate empty values. The converter also generates MediaWiki table markup as an alternative output format, useful for wiki editors and documentation platforms. You paste HTML directly into the text area or load an .html file, select your preferred output format, and the tool produces properly quoted, RFC 4180 compliant CSV. All processing happens locally using the browser DOMParser, which safely parses HTML without executing scripts or fetching external resources. This makes it safe for processing untrusted HTML from any source. The tool handles complex tables with nested elements, inline styles, and multi-line cell content.

How to use the Convert HTML Table to CSV tool

  1. Load your HTML data: Drag and drop your .html or .htm file, choose a file from your file explorer, or paste HTML content directly into the paste area.
  2. Configure output settings: Choose a CSV delimiter (comma, semicolon, tab, or pipe) and toggle whether the first row is a header.
  3. Convert to CSV: Click the "Convert Data" button to parse all <table> elements from the HTML into CSV rows.
  4. Export results: Copy the results to your clipboard, download as a local file, or export to Excel format.

Frequently asked questions

Can this tool convert tables with merged cells (colspan/rowspan)?
Yes. The parser handles colspan and rowspan attributes by filling merged cells with appropriate empty values, preserving the visual structure of the original table in CSV format.
What output formats are available?
You can choose between standard CSV output and MediaWiki table markup. Both formats preserve the table structure, headers, and data from the original HTML.
Does it handle tables with nested HTML elements inside cells?
Yes. The parser extracts text content from cells that contain nested elements like links, images, bold text, or other formatting. The text is preserved without HTML tags in the CSV output.
Can I extract multiple tables from a single HTML document?
Yes. If the HTML contains multiple <table> elements, the tool extracts and converts each table separately, concatenating the results into a single CSV output.
Is the HTML safely parsed without executing scripts?
Yes. The tool uses the DOMParser API, which parses HTML as a static document. No JavaScript is executed, no external resources are loaded, and no network requests are made during parsing.

Related tools