UT

HTML Table to CSV

Extract data from HTML tables and convert to CSV format.

What Is an HTML Table to CSV Converter?

An HTML table to CSV converter parses HTML markup containing <table> elements and extracts the cell data into comma-separated values. It handles colspan and rowspan attributes, preserving the original table structure. This tool runs 100% in your browser — your data is never uploaded to any server.

It supports file upload, drag-and-drop, URL import, multiple table selection, table preview, row and column count stats, copy to clipboard, and instant download.

How to Use This Tool

1

Add Your HTML

Paste HTML containing a <table> element into the input area, click Upload to select an .html file, drag and drop a file, or use URL Import to fetch a page from a remote address.

2

Extract to CSV

Click Extract to CSV to parse all table rows and columns. The tool handles colspan, rowspan, and nested header/body sections automatically.

3

Select a Table

If the HTML contains multiple <table> elements, use the Table dropdown in the output toolbar to switch between them. The row and column count updates accordingly.

4

Copy or Download

Copy the generated CSV to your clipboard or download it as a .csv file. The table preview below the CSV shows the extracted data in a formatted grid.

Features Explained

HTML Table Parsing

The parser uses the browser's built-in DOMParser to extract table data from any valid HTML. It reads <th> and <td> elements, correctly handling colspan and rowspan attributes to produce an accurate grid representation.

Multiple Table Support

If the HTML contains more than one <table> element, the tool detects all of them and shows a Table dropdown in the output toolbar. Select any table by its index to extract its data independently.

File Upload & Drag-and-Drop

Upload an .html, .htm, or .txt file using the Upload button, or drag and drop a file directly onto the input area. The file contents are loaded into the textarea for conversion.

URL Import

Click URL Import to fetch an HTML page from any remote address. The request goes directly from your browser to the target server — no intermediary. Note that CORS restrictions may prevent fetching from some domains.

Row & Column Stats

After extraction, the output toolbar shows the number of rows and columns extracted, plus the total number of tables found in the HTML if more than one exists.

Table Preview

A rendered HTML preview of the extracted data appears below the CSV output. The first row is highlighted as a header row to help you verify the extraction is correct.

Copy & Download

Copy the entire generated CSV to your clipboard with one click (shows Copied! for 1.5 seconds), or download it as a .csv file.

LocalStorage Persistence

Your input HTML, generated CSV output, and preview data are automatically saved to your browser's local storage. If you close the tab or refresh the page, your data will be restored.

Who Is This Tool For?

Web Developers

Extract table data from HTML pages for processing, migration, or analysis without writing scraping scripts.

Data Analysts

Convert HTML report tables into CSV for import into Excel, Google Sheets, or data analysis tools.

Content Managers

Pull structured data from web pages and CMS exports for repurposing in spreadsheets or databases.

QA Engineers

Extract test result tables from HTML reports and convert to CSV for tracking and comparison.

Researchers

Collect tabular data published on websites and convert it to CSV for statistical analysis.

Students & Learners

Understand how HTML table structure maps to CSV rows and columns, including colspan and rowspan handling.

Supported HTML Table Features

FeatureSupportedNotes
<th> and <td>YesBoth treated as cell data
colspanYesSpanned cells filled with empty strings
rowspanYesSpanned rows filled with empty strings
<thead> / <tbody> / <tfoot>YesAll sections included in output
Multiple <table> elementsYesSelect which table to extract
Nested tablesPartialOuter table is extracted; nested tables appear as text

Tips for HTML Table Extraction

Inspect the source

If a webpage table doesn't extract correctly, use your browser's View Source or Inspect Element to copy the actual <table> HTML rather than the rendered text.

Check for multiple tables

Some pages use multiple <table> elements for layout. After extraction, use the Table dropdown to find the one containing the data you need.

Handle merged cells

Cells with colspan or rowspan are supported. The merged area is filled with empty strings in the CSV, with the actual value in the top-left cell only.

URL Import and CORS

URL Import fetches pages directly from your browser. If a site blocks cross-origin requests, save the page as HTML and upload the file instead.

Large tables

The preview is scrollable for large tables. The CSV output includes all rows regardless of display limits.

Clean up before importing

Some HTML tables include formatting characters or extra whitespace. The extractor trims cell text, but you may need to post-process the CSV for edge cases.

Privacy & Security

This tool runs 100% in your browser. Your HTML data is never uploaded to any server. All parsing and extraction happens locally using the browser's built-in DOMParser.

Your input and output are saved only in your browser's local storage so they persist when you refresh the page. You can clear them at any time using the “Clear” button. No cookies are used, no analytics track your data content, and no third-party services have access to what you convert.