HTML Table to JSON
Convert HTML tables to JSON arrays instantly online. The first row becomes the keys; each subsequent row becomes an object. Free — runs entirely in your browser.
Related Tools
JSON → YAML
Convert JSON to YAML format instantly. Supports nested objects, arrays, and complex structures.
YAML → JSON
Convert YAML to JSON format instantly. Supports multi-document YAML and complex configurations.
CSV → JSON
Convert CSV to JSON array instantly. Automatic header detection and type inference.
HTML tables are a fundamental web structure used to display tabular data: pricing tables, comparison charts, statistical reports, sports standings, financial data, and database export previews. While they render well in browsers, extracting the data from an HTML table for use in code, databases, or data analysis tools requires parsing the HTML and converting the row/column structure to a machine-readable format. JSON is the most natural target: each row becomes an object with column headers as keys.
The conversion follows a simple convention: the first row of the table (whether using th or td cells) provides the column headers, which become the keys of each JSON object. Every subsequent row becomes one object in the output array, with its cell values mapped to the corresponding headers. This produces a JSON array of objects identical in structure to the JSON you would get from a REST API — ready for use with JavaScript, Python, or any data processing pipeline.
This tool parses the HTML using the browser's DOMParser, which correctly handles all standard table structures including thead/tbody/tfoot sections, nested elements inside cells (links, spans, formatted text), and irregular whitespace. The text content of each cell is extracted and trimmed, discarding any inline HTML formatting within cells.
Common Use Cases
Extracting data from web pages for analysis
Wikipedia tables, government statistics pages, sports statistics sites, and financial data portals publish data as HTML tables. Right-clicking the table in DevTools and copying the outer HTML, then pasting it here, produces a clean JSON array that can be imported into Python pandas, R data frames, or directly into a database — no web scraping library needed.
Converting HTML reports from legacy systems
Legacy enterprise systems (Oracle Reports, Crystal Reports, older Java EE applications) export data as HTML pages with table-based layouts. Converting these tables to JSON enables importing the data into modern systems, spreadsheets, or APIs without needing access to the original database or having the reporting tool regenerate the output in a different format.
Parsing HTML email data tables
Transactional emails from e-commerce platforms, banks, and SaaS tools often include HTML tables with order summaries, transaction histories, or usage data. Converting these tables to JSON makes the data importable into spreadsheets or databases for reconciliation, expense tracking, or auditing without manual data entry.
Migrating tabular data from static HTML pages
Documentation sites, wikis, and older intranets often contain reference tables (keyboard shortcuts, API error codes, supported file formats, configuration options) embedded as HTML. Converting these to JSON enables importing the data into a database, a Notion table, or an API, making it searchable and maintainable as structured data rather than as static HTML.
How to Use
- Paste an HTML snippet containing a
<table>element in the left panel. - The first row (
<th>or<td>) is used as the column headers (JSON keys). - Each subsequent row becomes a JSON object in the output array.
- Click "Copy Output" to copy the JSON array.