HTML Table to JSON Converter

Paste HTML that contains a table and get its rows as a JSON array, using the header cells as keys.

Processed on your device. Files are not uploaded

How to turn an HTML table into JSON

  1. Paste your HTML

    Paste or type it into the box, or press Try an example. Include the whole table.

  2. Pick the table

    If the page has several tables, choose which one.

  3. Copy or download

    Use the JSON in your code.

Worked example

This is what HTML Table to JSON Converter gives for its own sample values. Open the tool above and change anything to try your own.

HTML

<table>
  <tr><th>Name</th><th>Role</th></tr>
  <tr><td>Ada</td><td>Engineer</td></tr>
  <tr><td>Grace</td><td>Admiral</td></tr>
</table>
Indentation
2 spaces
Which table
1
Convert numbers and true/false
Yes

JSON

[
  {
    "Name": "Ada",
    "Role": "Engineer"
  },
  {
    "Name": "Grace",
    "Role": "Admiral"
  }
]

About HTML Table to JSON Converter

Extract a table from HTML as a JSON array, with the header cells used as keys.

FAQs

What if my table has no header?

The first row is used as the header anyway, so add one if you need different keys.

Are numbers converted?

Yes, by default. Turn the option off to keep everything as text.

Can I get CSV instead?

Use HTML Table to CSV Converter.

Related tools