Home › Developer Tools › HTML Table to CSV

HTML Table to CSV

Paste HTML, a page's source code or a table copied straight from a web page. Every <table> is detected, you pick the one you need, check it in the preview grid and export it as CSV, TSV or JSON. Merged cells (colspan and rowspan) are expanded correctly.

Last updated:

Tip: copy a table from any web page and paste it here; the HTML behind it is captured automatically.

Tables found
Preview
Advertisement
Advertisement

How to use the HTML Table to CSV

  1. Get the HTML. Copy a table from a web page and paste it, or open the page source (Ctrl+U / Cmd+Option+U), copy everything and paste it. You can also upload a saved .html file.
  2. Pick the table. Every table found is listed with its size and caption. Click one to select it.
  3. Check the preview grid and adjust the options: merged cells, header row, footnote marks and line breaks.
  4. Choose CSV, TSV or JSON as the output format.
  5. Copy or download the result. The CSV opens directly in Excel, Google Sheets or Numbers.

How merged cells are converted

HTML tables can merge cells across columns (colspan) and rows (rowspan), but CSV is a strict grid where every row has the same number of fields. The converter lays the table out exactly as a browser does, cell by cell, skipping positions already taken by a rowspan from above, and then fills each covered position.

HTMLRepeat value (default)Leave blank
<td colspan="2">Total</td>Total,TotalTotal,
<td rowspan="2">India</td> over two rowsIndia in both rowsIndia in the first row only

When a table has several header rows, for example a "Population" heading spanning "2015" and "2023", they are combined into one header row ("Population 2015", "Population 2023") so every column keeps a meaningful name in CSV and JSON.

CSV rules used

  • Fields that contain the delimiter, a double quote or a line break are wrapped in double quotes, and quotes inside are doubled ("He said ""hi"""), following RFC 4180.
  • Rows end with CRLF line breaks, which every spreadsheet program reads correctly.
  • The download starts with a UTF-8 byte order mark when Excel BOM is on, so Excel shows accented letters and symbols correctly instead of garbled characters.
  • In TSV output, tabs and line breaks inside cells are replaced with spaces, because TSV has no quoting.

Getting tables out of web pages

The quickest route is to select the table in your browser, copy it and paste it here: browsers put the table's HTML on the clipboard, and the tool uses it automatically. For very large tables or pages where selecting is awkward, open the page source (Ctrl+U on Windows and Linux, Cmd+Option+U on a Mac), select all and paste. If the source contains no <table>, the site builds its grid with JavaScript or <div> elements; use the browser's developer tools (right-click the table, Inspect, then copy the element's outer HTML) instead.

Frequently asked questions

How do I convert a table on a website to CSV?

Select the table on the page, copy it and paste it into the input box: the tool captures the HTML behind the copied table. If that does not work, open the page source with Ctrl+U (Cmd+Option+U on a Mac), copy all of it and paste it. Then pick the table and download the CSV.

How are colspan and rowspan handled?

Merged cells are expanded into a regular grid so every row has the same number of columns. By default the merged value is repeated in every cell it covers, which keeps filters and pivot tables working. Choose Leave blank to put the value only in the first cell.

Why is my table not found?

The tool reads <table> elements. Some sites build tables from <div> elements or load the data with JavaScript after the page opens, so the data is not in the page source. In that case copy the visible table from the page, or use the site's own export option.

Should I use CSV or TSV?

CSV with commas is the most widely supported format. Use semicolons if your Excel uses a comma as the decimal separator (common in Europe). TSV (tab-separated) is the safest for pasting straight into a spreadsheet and avoids quoting problems when cells contain commas.

What does the JSON output look like?

With Use first row as header on, the result is an array of objects whose keys come from the header row, for example [{"Country": "France", "Population": 68000000}]. With it off, you get an array of arrays.

Is the HTML uploaded or fetched?

No. The HTML is parsed by your browser with DOMParser, which does not run scripts or load images, and the conversion happens on your device.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

CSV to JSONConvert CSV data to JSON with live preview.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel to CSVConvert XLSX spreadsheets to CSV.Image to ExcelTurn a photo or screenshot of a table into an editable spreadsheet. Export XLSX or CSV.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.JSON to Go StructTurn JSON into Go structs with inferred types, nested structs and json tags.JSON to Python ClassGenerate Python dataclasses, Pydantic models or TypedDicts with type hints from JSON.JSON to C# ClassConvert JSON to C# classes or records with System.Text.Json or Newtonsoft attributes.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.JSON SorterSort JSON keys A-Z recursively, sort arrays by value or by a key, then pretty-print or minify.JSON to HTML TableConvert a JSON array of objects into clean HTML table code with CSS styles and a live preview.CSV to SQL ConverterConvert CSV to SQL CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.IPv4 to IPv6 ConverterConvert IPv4 to IPv4-mapped, 6to4 and NAT64 IPv6, extract IPv4 from IPv6, and get int/hex/binary.cURL to Code ConverterConvert curl commands to JavaScript fetch, Axios, Python requests, Node.js, PHP and Go code.Code to ImageTurn code into a beautiful syntax-highlighted PNG with themes, window frame and background.Excel to JSON ConverterConvert Excel sheets (XLSX, XLS, ODS) to JSON with header row, type and shape options.CSV to Excel ConverterConvert CSV files to a real .xlsx workbook with typed numbers and dates, one sheet per file.CSV SplitterSplit a large CSV into smaller files by row count, file count or column value, header kept.CSV MergerCombine many CSV files into one, matching columns by name, with dedupe and a source column.VCF to CSV ConverterConvert vCard (.vcf) contacts to CSV for Google or Outlook, or turn a CSV back into a VCF.Calendar Event (.ics) GeneratorCreate an .ics calendar invite with time zone, reminders and repeats + Google/Outlook links.CSV Column ExtractorPick, reorder and rename CSV columns, filter rows by value, and export a new CSV or JSON.CSV Diff CheckerCompare two CSV files by key column and see added, removed and changed rows cell by cell.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.CSV to HTML TableTurn CSV into clean HTML table code with a live preview, styling options and one-click copy.CSV to Markdown TableConvert CSV to a neatly aligned GitHub Markdown table with column alignment and live preview.CSV TransposeSwap rows and columns of CSV, TSV or pasted spreadsheet data, with delimiter auto-detect.Date Format ConverterConvert any date to ISO 8601, RFC 2822, Unix time and custom strftime, moment or Java patterns.ENV to JSON ConverterConvert .env files to JSON or YAML and JSON back to .env, with quotes and multiline values.File to Base64Convert any file to a Base64 string or data URI with MIME detection, line wrap and download.IEEE 754 Floating Point ConverterConvert decimals to 32/64-bit IEEE 754 floats: toggle bits, see hex, exact value and rounding error.INI to JSON ConverterConvert INI and CFG files to JSON and JSON back to INI, with sections, arrays and types.IP Address ConverterConvert IPv4 to decimal, hex, binary, octal and back, with class and private/public check.ISBN Converter & ValidatorConvert ISBN-10 to ISBN-13 and back, validate check digits and hyphenate, one or in bulk.JSON Flatten / UnflattenFlatten nested JSON to dot or bracket path keys, or unflatten flat keys back to nested JSON.
See all 129 Data & File Format Converters →