HTML to JSON
Convert an HTML table into JSON.
HTML Table to JSON Converter Online
The HTML to JSON converter reads a <table> from HTML and produces structured JSON. It's the fast path from a table on a web page to data your code can use: seed a database, mock an API response, feed a chart, or compare figures programmatically. Paste the markup (or open a saved .html file) and the JSON is generated as you type.
Choose a JSON shape
- Array of objects – one object per table row, keys from the header. The natural format for APIs and front-end components.
- Array of arrays – header row first, then values. Compact and positional.
- Object of columns – each header maps to an array of that column's values, perfect for charting libraries.
- Keyed by first column – rows stored under the value of their first cell, useful when the first column is an ID or name.
Header detection
In Auto mode the first row is used as header only when it lives in <thead> or consists entirely of <th> cells, which matches how well-built tables are marked up. Choose First row for tables that use plain <td> for headings, or No header for raw grids.
Robust extraction
The extractor finds every table in the input, even inside large page sources with scripts and styles. It removes inline tags (<a>, <strong>, <em>), decodes HTML entities like € and , and aligns merged cells: colspan produces empty values for the extra columns and rowspan repeats the value downward, so every object has the same keys. Nested tables are pulled out as their own numbered tables.
Typed values
Type detection turns 4 into a number and true into a boolean, while values like €24.00 or 007 stay strings. Everything runs locally in your browser.
Related tools
Also available: HTML to CSV, HTML to XML, and HTML to YAML. Explore the JSON in the JSON Viewer or turn it back into a table with JSON to HTML.
Frequently Asked Questions
What keys do the JSON objects get?
The header cells become the keys, e.g. “Price / month”. Without a header row (or with the No header option) the keys are column1, column2, and so on. Empty or repeated header names are made unique so no value is overwritten.
Why is “2 GB” a string but “2” a number?
With “Detect numbers & booleans” on, cells that are exactly a number or true/false are converted; anything with units, currency symbols, or thousands separators stays text so nothing is misread. Switch the option off to keep every cell as a string.
My page has several tables — which one is converted?
All <table> elements in the pasted HTML are detected, including nested ones, and the Table number option selects one of them (1 = first in the source). The preview under the editor shows which table you are converting.