Tools In
Browser

HTML Table to CSV

Free HTML Table to CSV Converter online. Extract HTML tables to CSV with colspan, rowspan, multi-table picker and live preview. Runs in Your Browser.

How to Use This Tool

1

Add Your HTML

Type or paste HTML containing one or more <table> elements directly into the Input textarea, click Upload to pick a .html, .htm, or .txt file, drag and drop a file onto the input area, or click URL Import and enter an HTTP(S) URL to fetch a remote page. The full source HTML is loaded into the textarea unchanged - the tool finds the <table> tags later.

2

Extract to CSV

Click Extract to CSV. The tool parses the HTML with the browser's built-in DOMParser, finds every <table> element on the page, walks the rows and cells of the selected table, respects colspan and rowspan to keep columns aligned, trims each cell's text content, and produces RFC 4180 escaped CSV in the output panel. The full CSV is generated in one shot - the live HTML table preview is capped at the first 100 rows and the CSV text preview at the first 500 lines so the page stays responsive even on multi-megabyte HTML pages.

3

Pick a Table (if more than one)

If the page contains multiple <table> elements, a Table dropdown appears in the output toolbar showing how many tables were found. Pick the one you want to extract and the tool re-runs the extraction for that index, updating the row count, column count, CSV output, and live preview.

4

Copy or Download

Click Copy CSV to copy the entire output to your clipboard (the button briefly shows "Copied!"), or Download CSV to save it as a table.csv file you can open in Excel, Google Sheets, LibreOffice Calc, or any data tool. Click Clear to wipe the input, output, preview, and table selection in one action.

Frequently Asked Questions

Is my HTML uploaded to a server?

No. Your HTML is never sent to our servers - all parsing, table extraction, CSV generation, copy, and download happen directly in your browser on your device using the built-in DOMParser API. The only network request the tool ever makes is the one you trigger explicitly with URL Import, which goes from your browser to the URL you enter.

Does it handle colspan and rowspan?

Yes. The extractor measures the table grid in a first pass using each cell's colspan and rowspan attributes, then fills a 2D grid in a second pass. The top-left cell of a merged area holds the actual value, and the rest of the merged area is filled with empty strings so the resulting CSV is rectangular and column positions stay aligned.

What if the page contains multiple <table> elements?

The tool counts every <table> on the page during extraction. If more than one is found, a Table dropdown appears in the output toolbar so you can switch between them. Each selection re-extracts that table independently and updates the row/column count and live preview.

Can I extract tables from a live web page by URL?

Yes - click URL Import, paste the page URL, and click Fetch. The browser issues a normal fetch() request to that URL, then the HTML is parsed locally. The target site must allow cross-origin requests via CORS headers - if it does not, you will see a network error. In that case, save the page as HTML in your browser and use Upload instead.

Does the tool include <thead>, <tbody>, and <tfoot> rows?

Yes. The extractor walks every <tr> in the table regardless of which section it lives in, so header rows, body rows, and footer rows all end up in the output CSV in source order. The first row in the CSV is whatever the first <tr> in the HTML is - usually the header row.

What are <th> cells turned into?

Both <th> and <td> are treated as plain cell values - their text content is extracted and trimmed. The CSV format itself has no concept of header cells, so the first row of the CSV is conventionally the header but is not marked specially.

How are special characters in cells handled in the CSV?

Cell text is wrapped in double quotes and any embedded double quotes are escaped by doubling (") whenever the cell contains a comma, a double quote, or a newline. Cells without those characters are written bare. This follows the standard RFC 4180 CSV escaping rules so the output opens correctly in Excel, Google Sheets, LibreOffice Calc, and any CSV parser.

What happens with very large HTML tables?

The tool is optimized for big tables. The full CSV output is always generated and available via Copy and Download, but the on-screen displays are capped: the CSV text preview is limited to the first 500 lines and the live HTML table preview is limited to the first 100 rows. This keeps the page responsive even on multi-megabyte HTML pages with tens of thousands of rows.

Will my work be lost if I refresh the page?

Yes. This tool intentionally does not save your HTML input, extracted CSV, or preview to your browser's local storage - storing large HTML pages on every keystroke would slow the tool down. Re-paste, re-upload, or re-fetch your HTML after a refresh.

Convert HTML Table to CSV Online Free - No Upload Required

Convert HTML tables into clean CSV data online for free with this browser-based HTML Table to CSV converter. Paste an HTML page, upload .html / .htm / .txt files, drag and drop, or fetch directly from a URL - the tool parses the markup with the browser's native DOMParser, walks every <tr>, <th>, and <td>, respects colspan and rowspan to keep columns aligned, and produces RFC 4180 escaped CSV that opens cleanly in Excel, Google Sheets, LibreOffice Calc, and any data tool. Your HTML is never sent to our servers. No registration or software installation required.

This online HTML Table to CSV converter supports multi-table pages with a Table picker dropdown, full colspan and rowspan handling that keeps the resulting grid rectangular, automatic cell-text trimming, RFC 4180 quoting and double-quote escaping, full <thead> / <tbody> / <tfoot> coverage, paste and Upload and drag-and-drop and URL Import, a live HTML table preview limited to the first 100 rows, a CSV text preview limited to the first 500 lines, row and column count statistics, Copy CSV with feedback, Download CSV as a complete .csv file, and a one-click Clear that wipes everything immediately. Works on huge HTML pages without freezing the browser. No registration needed to start extracting instantly.

Features Explained

DOMParser-Based HTML Parser

The tool uses the browser's native DOMParser API (the same engine that renders web pages) to parse your HTML. This means malformed tags, missing closing tags, weird attribute quoting, and the messy real-world HTML you copy from a saved web page are all handled correctly without a third-party library.

Multi-Table Detection with Picker

After extraction, the tool counts every <table> element on the page. If more than one is found, a Table dropdown appears in the output toolbar showing "Table 1", "Table 2", and so on. Picking a different entry re-runs the extraction for that table index and updates the row/column count, CSV output, and live preview. The row stats line also shows the total table count next to the row/column numbers.

Full colspan and rowspan Support

The extractor uses a two-pass grid algorithm. The first pass measures the table's true grid size by reading every cell's colspan and rowspan attributes. The second pass fills a 2D grid where the top-left of each merged cell holds the actual value and the rest of the merged area is filled with empty strings. The resulting CSV is rectangular - column positions stay aligned across rows even when the source HTML has heavy cell merging.

<thead>, <tbody>, and <tfoot> Coverage

The extractor walks every <tr> in the selected table regardless of which sectioning element it lives inside. Header rows, body rows, and footer rows all end up in the output CSV in source order. The first <tr> is conventionally the header row but is not marked specially - the CSV format itself has no concept of header cells.

Cell Text Trimming

Each cell's text content is read with the standard textContent property and trimmed of leading and trailing whitespace before being written to the CSV. This strips the indentation and line breaks that pretty-printed HTML adds inside cells, so the resulting CSV doesn't carry stray spaces or newlines.

RFC 4180 CSV Escaping

Cell values are wrapped in double quotes and any embedded double quotes are escaped by doubling (") whenever the cell contains a comma, a double quote, or a newline. Cells without those characters are written bare. This follows the standard RFC 4180 rules so the output opens cleanly in Excel, Google Sheets, LibreOffice Calc, Python's csv module, and any other CSV reader.

Paste, Upload, Drag-and-Drop & URL Import

Four ways to load HTML data: type or paste straight into the textarea, click Upload to pick a .html / .htm / .txt file, drag a file onto the Input area, or click URL Import to reveal a URL field that calls fetch() directly from your browser to the target page with no proxy. URL Import requires the target server to allow cross-origin requests via CORS headers.

Live HTML Table Preview (capped at 100 rows)

Below the CSV output, the tool renders a live preview of the extracted grid as an HTML table so you can verify the extraction visually. For very large tables the preview is limited to the first 100 rows so the browser does not have to lay out millions of DOM nodes - a notice next to the Preview label tells you how many rows the full table actually has. Copy and Download always operate on the full untruncated CSV.

CSV Code Preview (limited to 500 lines)

The output panel shows the generated CSV in a read-only text area so you can read and inspect the data. For huge tables the displayed text is limited to the first 500 lines and a notice next to the Output label tells you the preview is limited. Copy and Download always work on the full output - the cap is purely a display safeguard to keep the page responsive when the generated CSV is megabytes long.

Row & Column Statistics

After extraction, a small status line in the output toolbar shows the number of rows and columns extracted, plus the total number of <table> elements found in the source HTML when more than one is present. This is useful for sanity-checking before you copy or download.

Copy CSV with Feedback

Click Copy CSV to copy the entire generated output to your clipboard via navigator.clipboard.writeText(). The button label briefly changes to "Copied!" for 1.5 seconds as confirmation, then reverts.

Download as .csv File

Click Download CSV to save the output as a table.csv file. The blob is created locally on your device and the temporary object URL is released after the download is triggered.

No Persistence (Fast on Big Pages)

This tool intentionally does not save your HTML input, generated CSV, or preview to your browser's local storage. Storing large HTML pages on every keystroke is exactly what makes other tools freeze - skipping persistence keeps this one snappy even on multi-megabyte pages with tens of thousands of rows. Re-paste, re-upload, or re-fetch your HTML after a refresh.

One-Click Clear

Click Clear to wipe the input textarea, the generated CSV, the live preview, the table count and selection, the URL Import bar, and any error message in a single action.

Who Is This Tool For?

Web Developers

Pull table data out of static HTML pages, scraped content, and saved web pages without writing a parser - useful when migrating legacy content or rebuilding a database from old HTML.

Frontend Developers

Quickly extract sample table data from a live page to drop into a fixture file, a test case, or a CSV-driven component without setting up a scraping toolchain.

Backend Developers

Convert HTML report tables generated by old systems or third-party tools into CSV that can be loaded into a database, an API import, or a data pipeline.

Data Analysts

Convert HTML tables found in reports, dashboards, news pages, and Wikipedia articles into CSV for import into Excel, Google Sheets, Pandas, or any data analysis tool.

Data Scientists

Grab tabular data from a webpage and turn it into a CSV file you can read into a notebook in seconds - faster than wiring up requests + BeautifulSoup for a one-off extraction.

BI Analysts

Pull KPI tables out of internal dashboards and customer-facing reports for archiving, comparison, and import into your warehouse or reporting database.

ETL Developers

Use this tool to prototype HTML-to-CSV conversion logic by hand before wiring it into a production pipeline - and to spot-check what your pipeline produces against the same HTML.

Researchers & Academics

Collect tabular data published on websites (statistics tables, journal article data, government reports) and convert it to CSV for statistical analysis in R, Python, SPSS, or Stata.

Journalists

Extract tables from government press releases, court filings, sports pages, and election results pages into CSV for analysis and visualization in your reporting.

OSINT Analysts

Convert HTML tables from leaked documents, archived web pages, and Wayback Machine captures into CSV for searching, sorting, and pivoting during investigations.

Tech Support Staff

Convert HTML status pages, log tables, and customer-supplied web exports into CSV for triaging issues and replying to tickets.

QA Engineers

Pull test result tables out of HTML reports generated by Allure, ReportPortal, Cypress dashboards, or in-house tools, and convert them to CSV for tracking and trend analysis.

Test Automation Engineers

Extract tabular fixtures and golden-file outputs from saved HTML pages for use in test suites, regression checks, and snapshot comparisons.

DevOps Engineers

Convert HTML inventory pages, monitoring dashboards, and exported runbook tables into CSV for parsing, scripting, and import into config databases.

SRE Engineers

Pull incident timelines, alert tables, and metrics tables out of HTML status pages and postmortems to feed analysis spreadsheets and incident reviews.

Project Managers

Convert HTML status tables, sprint reports, and roadmap tables exported from project tools into CSV for sharing in spreadsheets and aggregating across teams.

Product Managers

Extract competitor pricing tables, feature comparison matrices, and changelog tables from public web pages into CSV for analysis and quoting in spec docs.

Marketing Teams

Convert HTML tables from competitor sites, partner reports, and survey result pages into CSV for processing in your CRM, analytics tools, and marketing dashboards.

SEO Specialists

Pull SERP tables, ranking reports, and keyword data tables from HTML exports of SEO tools into CSV for further analysis in spreadsheets.

Wikipedia Editors

Convert wikitable HTML output into CSV for editing offline in a spreadsheet, then re-import the cleaned data back into your wiki page.

Open Source Maintainers

Convert benchmark result tables, supported-platform matrices, and changelog tables from generated HTML docs into CSV for graphs and stats.

Educators & Trainers

Demonstrate how HTML table structure (rows, cells, colspan, rowspan) maps to a flat CSV grid in web development, data, and computer science classes.

Students

Convert HTML tables from reading assignments, online textbooks, and reference sites into CSV for processing in homework assignments and lab projects.

Anyone with HTML and a need for CSV

Whenever you have a tabular dataset trapped inside an HTML page and want it as CSV that opens in Excel or any data tool, this is the fastest way to get it out.

Tips for HTML Table Extraction

Copy the actual HTML, not the rendered text

If you copy a table from a rendered web page, you usually get plain text without any <table> tags - which this tool can't extract. Use your browser's View Source or Inspect Element panel to copy the real HTML, including the <table>, <tr>, and <td> tags.

Save tricky pages as HTML and upload

If a page is generated by JavaScript or blocks cross-origin requests so URL Import fails, save the page in your browser (Ctrl+S / Cmd+S) and use Upload to load the .html file. The DOMParser sees exactly what your browser saved.

Check the table count when extracting

Many real web pages contain multiple <table> elements - some for data and some for layout. After clicking Extract to CSV, look at the row stats line and the Table dropdown to find the table you actually want, not just the first one on the page.

Verify merged cells in the live preview

Tables with colspan or rowspan can produce unexpected layouts in CSV. Check the live HTML table preview below the CSV output to confirm the extraction matches what you see on the source page - merged areas appear with the value in the top-left and empty strings filling the rest.

Spot-check the row and column count

After extraction, the row and column count is shown next to the Table dropdown. If the numbers look wrong (too few rows, too many columns), you may have selected the wrong table or the source HTML may be malformed in a way the parser couldn't recover from.

URL Import requires CORS

URL Import calls fetch() directly from your browser, which is subject to the same-origin policy. Many sites do not send CORS headers that allow cross-origin reads, so the request fails. When that happens, save the page locally with Ctrl+S and use Upload instead.

Use Download for huge outputs

If your CSV has tens of thousands of rows, the on-screen text preview is capped at the first 500 lines and the live HTML table preview at the first 100 rows. The Download CSV button always saves the full unfiltered output, so use it when you need every row.

Re-paste after a page refresh

This tool does not save your HTML or output to localStorage - that decision keeps the tool fast on huge pages, but it means a refresh wipes everything. Re-paste, re-upload, or re-fetch your HTML if you need it back.

Open the CSV in Excel or Google Sheets to verify

After downloading, double-click the file to open it in Excel, LibreOffice Calc, or Google Sheets. RFC 4180 quoting handles commas, quotes, and newlines inside cells correctly across all major spreadsheet tools.

Watch out for invisible whitespace

Pretty-printed HTML often puts indentation and line breaks inside <td> tags. The extractor trims leading and trailing whitespace from each cell, but multi-line cell content with internal whitespace is preserved as-is. Inspect a sample row if you suspect odd spacing.

Test the extraction on a small slice first

If you're not sure whether a complex page extracts correctly, copy just one or two <table>...</table> blocks into the input and run Extract to CSV. This lets you confirm the column layout before processing the whole page.

Use Clear when switching tables

After extracting one table you may want to extract a different unrelated page. Click Clear to wipe everything (input, output, preview, table count) and start fresh - prevents leftover state from confusing the next extraction.

Supported Input Formats

The Input textarea accepts any HTML containing one or more <table> elements. The browser's native DOMParser handles malformed and real-world HTML gracefully, so you do not need to clean the source before pasting.

HTML FeatureSupportedNotes
<th> and <td>YesBoth treated as cell data; text content is trimmed
colspanYesMerged area filled with empty strings; value in top-left only
rowspanYesMerged area filled with empty strings; value in top-left only
<thead> / <tbody> / <tfoot>YesAll sections walked in source order; no special header marking
Multiple <table> elementsYesTable picker dropdown appears in the output toolbar
Malformed HTMLYesDOMParser repairs missing closing tags and quotes
Nested tablesPartialOuter table is extracted; nested tables collapse to text content of the parent cell
JavaScript-rendered tablesNoDOMParser parses static HTML only; save the page in your browser first
<caption>IgnoredTable caption is not included in the CSV output

You can get HTML into the textarea four ways:

  • Type or paste directly into the Input textarea.
  • Upload button - opens a file picker scoped to .html, .htm, and .txt. The file is read locally with FileReader.readAsText().
  • Drag and drop - drop an HTML file onto the Input area.
  • URL Import - reveals a URL field, then calls fetch() directly from your browser. The target URL must allow cross-origin requests via CORS headers.

CSV Output Format

The output follows the standard RFC 4180 CSV rules so it opens cleanly in any spreadsheet program or CSV parser:

  • Cells are separated by commas (,).
  • Rows are separated by newline (\n).
  • Cells containing ,, ", or a newline are wrapped in double quotes.
  • Embedded double quotes inside a quoted cell are escaped by doubling them ("").
  • Cells from merged areas (other than the top-left of the merge) are emitted as empty strings to keep the grid rectangular.

Privacy & Security

This free HTML Table to CSV converter runs entirely in your browser. Your HTML, extracted CSV, and preview data are never sent to our servers - all parsing, table extraction, colspan and rowspan handling, RFC 4180 escaping, copy, and download happen on your device using the browser's built-in DOMParser. The only network request the tool ever makes is the one you trigger explicitly with URL Import, which goes directly from your browser to the URL you enter.

Your HTML input, generated CSV, and preview are intentionally not saved to your browser's local storage. Storing large HTML pages on every keystroke is exactly what makes other tools freeze - skipping persistence keeps this one fast even on multi-megabyte pages. Click Clear to wipe the input, output, and preview immediately. We have no logs, no analytics on your data content, no tracking, and no database.

Related Tools in File & Data