HTML Table to JSON Converter

Paste an HTML table and extract it as a JSON array of objects.

🔒 100% private — runs entirely in your browser

or try sample data

What is HTML Table to JSON?

HTML Table to JSON extracts data from an HTML <table> element and converts it into a JSON array of objects. Column headers become object keys, and each table row becomes an object.

The tool uses the browser's built-in DOMParser to parse the HTML, then extracts headers from <thead> (or the first row if no thead exists) and data from <tbody> rows. It handles both <th> and <td> cells.

This is useful for extracting data from web pages, converting HTML reports to JSON, or quickly getting structured data from table-based HTML emails. Paste just the table HTML — you don't need the full page.

HTML Table to JSON — Common Use Cases

Standard table with thead/tbody

<table> <thead> <tr><th>Name</th><th>Age</th></tr> </thead> <tbody> <tr><td>Alice</td><td>30</td></tr> <tr><td>Bob</td><td>25</td></tr> </tbody>
</table> // Converts to:
[ { "Name": "Alice", "Age": 30 }, { "Name": "Bob", "Age": 25 }
]

Simple table (no thead)

<table> <tr><td>Product</td><td>Price</td></tr> <tr><td>Widget</td><td>9.99</td></tr>
</table> // First row is used as headers automatically

If there's no <thead>, the first <tr> is treated as the header row.

HTML Table Parsing Gotchas

Merged cells (colspan/rowspan)

The tool reads cell content in order without interpreting colspan or rowspan attributes. Tables with merged cells may produce misaligned data. Unmerge cells before converting for best results.

Multiple tables

Only the first <table> element in the input is processed. If your HTML contains multiple tables, separate them and convert one at a time.

HTML entities

HTML entities like &amp;, &nbsp;, and &lt; are automatically decoded to their text equivalents in the JSON output.

Frequently Asked Questions

How do I convert an HTML table to JSON?

Paste the HTML containing a <table> element and click "Convert to JSON". Headers are detected from <thead> or the first row, and data rows become JSON objects.

Do I need the entire HTML page?

No. You only need the <table> element and its contents. The tool finds the first table in whatever HTML you provide.

How do I get the HTML of a table from a web page?

Right-click the table in your browser, choose "Inspect", find the <table> element in DevTools, right-click it, and select "Copy > Copy outerHTML".

Is my data safe?

Yes. The HTML is parsed using your browser's built-in DOMParser. No data is sent to any server.