HTML Table to JSON Converter
Turn an HTML table into a JSON array of objects online. Header keys, camelCase or snake_case, number and boolean coercion, NDJSON output — all in-browser.
What is the HTML Table to JSON Converter?
The ByteTools HTML Table to JSON Converter reads table markup and gives you back structured JSON you can drop straight into an API fixture, a test file or a script.
- Header row becomes object keys, duplicates suffixed automatically
- camelCase, snake_case or verbatim key naming
- Optional number and boolean coercion
- Array of objects, 2D array or NDJSON output
- Expands rowspan and colspan before mapping
- 100% local — the markup never leaves your browser
How to use the HTML Table to JSON Converter
- 1
Paste your HTML, or drop an .html file into the drop zone.
- 2
Click Extract tables and choose the table you want from the dropdown.
- 3
Pick the output shape: array of objects, 2D array or NDJSON.
- 4
Set the key casing and tick the coercion options you want.
- 5
Copy the JSON or download it as .json or .ndjson.
About the HTML Table to JSON Converter
The ByteTools HTML Table to JSON Converter reads table markup and gives you back structured JSON you can drop straight into an API fixture, a test file or a script. Paste the HTML, click Extract tables, and choose whether the first row is a header row that should become the object keys.
You control the shape of the result: an array of objects keyed by header, a plain two-dimensional array, or NDJSON with one object per line for streaming tools. Keys can be kept exactly as written or rewritten to camelCase or snake_case, and duplicate headers are de-duplicated with a numeric suffix so no data is lost.
Numeric cells can be converted to real JSON numbers and true/false/yes/no cells to booleans, or left as strings if you prefer exact fidelity. The whole conversion runs locally in your browser using DOMParser — the markup you paste is never uploaded to a server.
Frequently asked questions
How do I turn an HTML table into a JSON array of objects?
Paste the markup, click Extract tables, keep 'First row is a header' ticked and leave the output shape on 'Array of objects'. Each body row becomes one object whose keys come from the header cells.
What if my table has no header row?
Untick 'First row is a header'. The keys then become column 1, column 2 and so on, or you can switch the output shape to a plain 2D array to keep every row exactly as it appears.
Why are my numbers still strings?
Number coercion is a checkbox you can turn off. When 'Convert numeric cells to numbers' is ticked, values such as 1,234.5 or 42 become JSON numbers; with it off, everything stays a string so leading zeros and IDs are preserved.
What is NDJSON and when should I use it?
NDJSON is newline-delimited JSON — one complete object per line, with no surrounding array. It is the format BigQuery, Elasticsearch bulk loads and many log pipelines expect because each line can be parsed independently.
Are duplicate column headers a problem?
No. If two header cells have the same text, the second becomes name_2, the third name_3 and so on, so every column keeps its own key and no values are silently overwritten.
Related tools
HTML Table to CSV Converter
Convert an HTML table to CSV online. Expands rowspan and colspan, picks between several tables on a page and quotes fields properly — all in your browser.
CSV to JSON Converter
Convert CSV to a JSON array of objects online. Header-row detection, comma/semicolon/tab delimiters and pretty-printed output — 100% in your browser.
JSON to TypeScript
Generate TypeScript interfaces from a JSON sample online. Infers types recursively, merges array shapes and marks optional keys — 100% in your browser.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
Markdown Table to CSV Converter
Convert GitHub-flavoured Markdown pipe tables to CSV or TSV online. Strips bold, code and links, handles escaped pipes and finds every table in a document.