HTML Table to JSON Converter
Paste an HTML table or a page snippet and convert every table to JSON and CSV in your browser. The markup you paste stays on your device.
The HTML Table to JSON Converter parses the markup you paste entirely in your browser. The table HTML and the JSON or CSV it produces stay on your device and are never uploaded to ArrayKit.
Open the JSON Formatter
About HTML Table to JSON
The HTML Table to JSON Converter turns any pasted <table> — or a whole page snippet full of them — into a clean JSON array of row-objects and matching CSV. Each header cell becomes a key, so a row like <td>Ada</td><td>Admin</td> reads as { "Name": "Ada", "Role": "Admin" }. It understands thead and tbody, uses th cells as headers, synthesizes column_1, column_2 labels when a table has none, and expands colspan and rowspan so every row lines up in a rectangular grid. When the markup holds several tables you can switch between them and copy each result on its own. It is built for scraping a report, moving a spec sheet into code, or seeding a fixture from documentation. The HTML you paste is parsed locally and never leaves your device.
Features
- Extracts every <table> in the pasted HTML, not just the first one
- Header cells (<th>) become JSON keys; rows become an array of objects
- Handles thead and tbody, and falls back to the first row when there is no thead
- Expands colspan by repeating the cell across the columns it covers
- Carries rowspan cells down into the rows they span
- Synthesizes column_1, column_2 keys for tables with no header row
- One-click JSON and CSV output with copy and download for each table
- Parses the markup in your browser so the HTML never leaves your device
How to use the HTML Table to JSON
- Paste an HTML <table> or a page snippet that contains one or more tables
- Switch between JSON and CSV with the format toggle
- If several tables were found, pick one from the Table selector
- Copy the output or download it as a .json or .csv file
Example
Input
<table><thead><tr><th>Name</th><th>Role</th></tr></thead><tbody><tr><td>Ada</td><td>Admin</td></tr><tr><td>Linus</td><td>Author</td></tr></tbody></table>
Output
[
{ "Name": "Ada", "Role": "Admin" },
{ "Name": "Linus", "Role": "Author" }
]
The <th> cells become the object keys and each <tr> becomes one row-object.
Common errors & troubleshooting
- "No <table> found in the HTML." — Make sure the pasted snippet actually contains a <table> element. A grid built from <div>s or a CSS layout is not an HTML table and cannot be extracted.
- Headers show up as column_1, column_2 instead of real names. — The table has no <thead> and no <th> in its first row, so labels are synthesized. Add a header row with <th> cells to get meaningful keys.
- A merged cell repeats across several columns or rows in the output. — That is expected: colspan and rowspan are expanded so the grid is rectangular. The spanned value is copied into every cell it covered.
- Two columns share a header and one key overwrites the other. — Duplicate header labels are de-duplicated as name, name_2, and so on, so each column keeps a distinct JSON key instead of clobbering.
Frequently asked questions
- How does the converter pick the JSON keys from my table?
- It uses the header cells. A <thead> row, or a first row that contains <th> cells, supplies the keys. Each following row becomes one object whose values are aligned to those headers by column position.
- What happens to colspan and rowspan cells?
- They are expanded into a dense grid. A colspan cell is repeated across every column it covers, and a rowspan cell is carried down into each row it spans, so every row-object has the same set of keys.
- Can it extract more than one table from a page snippet?
- Yes. Paste a whole snippet and every <table> is extracted in document order. A Table selector lets you switch between them and copy each table's JSON or CSV separately.
- What if my table has no header row?
- When there is no <thead> and no <th> in the first row, the tool synthesizes keys named column_1, column_2, and so on, and treats every row as data instead of dropping the first one.
- Does it also output CSV, not just JSON?
- Yes. Flip the format toggle to CSV to get an RFC-4180 export where values containing commas, quotes, or newlines are quoted correctly. You can copy it or download a .csv file.
- Is the HTML I paste uploaded anywhere?
- No. The markup is parsed in your browser with the standard DOM parser and the resulting JSON and CSV are built on your device. The pasted table is never sent to a server.
Related tools
- CSV to JSON — Convert CSV or TSV to JSON with type inference and nested keys, in your browser.
- JSON to CSV — Convert an array of flat JSON objects to CSV.
- CSV to Markdown Table — Convert CSV or TSV data into a Markdown table, with alignment and header options.
- HTML to Markdown — Paste HTML and convert it to clean Markdown live, with GFM tables, lists and code blocks.
- Excel to JSON — Convert an .xlsx or .xls spreadsheet to JSON, with sheet and header options, in your browser.
- JSON Formatter — Beautify, minify and validate JSON with error locations.
All ArrayKit tools