HTML Table to CSV Converter
Convert HTML tables to CSV format for Excel, spreadsheets, and data analysis. Extracts table data from web pages, emails, and documents into clean CSV files.
Conversion Options
Supported:
• <thead>, <tbody>, <tfoot> elements
• <th> and <td> cells
• colspan attributes (expanded to empty cells)
• HTML entities and nested formatting
Tip: Copy table HTML from browser DevTools
Recommended Settings
Pro Tips
- •Right-click any table on a webpage and 'Inspect Element' to copy the HTML
- •CSV files can be opened directly in Excel, Google Sheets, and most spreadsheet applications
- •Handles complex tables with thead, tbody, colspan, and nested HTML formatting
- •Use semicolon delimiter for European Excel versions that expect ; instead of ,
Most Popular
Most users include headers and trim whitespace for clean CSV output
When to Use This Tool
Extract tabular data from websites, online reports, and web applications. Copy HTML table code from browser DevTools (right-click → Inspect) and convert to CSV for analysis in Excel or databases. Perfect for collecting pricing data, product catalogs, financial tables, and statistical reports from web pages without manual copy-paste.
Convert HTML email tables and rich-text document tables to CSV for data processing. Many email reports, newsletters, and automated notifications contain tables that need to be extracted into spreadsheets. Useful for processing shipping notifications, sales reports, and analytics emails sent as HTML tables.
Export data from old web applications or admin panels that only display data as HTML tables. Convert tables from legacy systems, content management systems, or database admin tools to CSV for import into modern systems. Essential for data migration projects and system upgrades.
Transform HTML report tables from dashboards, analytics tools, and monitoring systems into CSV for further analysis. Combine multiple HTML table exports into unified datasets, create pivot tables, or feed data into business intelligence tools. Automates the manual process of copying web tables to spreadsheets.
How It Works
Parse the input HTML using browser's DOMParser to create a DOM tree
Locate all <table> elements and select first or last based on options
Extract headers from <thead> or first row with <th> elements if includeHeaders enabled
Iterate through <tbody> rows, extracting text from <td> and <th> cells
Remove HTML tags, decode entities, and clean up whitespace from cell content
Handle colspan attributes by adding empty cells to match column spans
Escape CSV special characters: quote fields containing delimiters, quotes, or newlines
Join cells with selected delimiter (comma, semicolon, tab, or pipe)
Format output as RFC 4180 compliant CSV with proper escaping
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Pure JavaScript with DOMParser for optimal performance on modern browsers.
Secure
No data collection, no tracking, no sign-up required.
Frequently Asked Questions
How do I get the HTML code from a webpage table?
Right-click on the table in your browser and select 'Inspect' or 'Inspect Element'. This opens DevTools with the table's HTML highlighted. Right-click the <table> element in the HTML panel and choose 'Copy → Copy outerHTML'. Paste this code into the converter. You can also view the page source (Ctrl+U or Cmd+U) and copy the table HTML directly.
What happens to merged cells (colspan/rowspan)?
Colspan attributes are handled by adding empty cells to match the column span. For example, a cell with colspan='3' becomes three cells: the original content plus two empty cells. Rowspan is not currently supported and will be treated as a regular cell. This ensures the CSV maintains the correct column alignment.
Can this handle tables with nested HTML formatting?
Yes! The converter strips all HTML tags (including <b>, <i>, <a>, <span>, etc.) and extracts only the text content. HTML entities like &, <, are automatically decoded. Script and style tags are removed completely. This gives you clean plain text in the CSV output.
Why use semicolon instead of comma as delimiter?
European versions of Excel expect semicolons (;) as the default CSV delimiter because commas are used as decimal separators in many European locales (e.g., 1,234.56 vs 1.234,56). If you're in Europe or sharing files with European users, use semicolon delimiter to ensure Excel opens the file correctly without an import wizard.
What if my HTML has multiple tables?
By default, the converter extracts the first table found. Uncheck 'Extract first table only' to get the last table instead. If you need data from multiple tables, run the conversion multiple times: paste HTML with the first table, convert, then paste HTML with the second table and convert again. Each conversion processes one table.
Can I import the CSV into Excel or Google Sheets?
Yes! The output follows RFC 4180 CSV standard and works with all major spreadsheet applications. Excel: File → Open or drag the .csv file. Google Sheets: File → Import → Upload. The tool properly quotes fields with special characters and escapes quotes, ensuring data integrity when imported. Choose the appropriate delimiter for your region.