DataHub Tools HTML Table to JSON

HTML Table to JSON Converter

Local-first

Extract rows from an HTML table and convert them into JSON arrays.

How this tool actually works

The converter parses pasted HTML, selects the first table, treats its first row as field names, and maps later cell text to JSON objects. It is intended for a single rectangular table with unique one-row headers.

  • Read the first HTML table
  • Use first-row cells as JSON keys
  • Extract cell text into object rows

How to use it

  1. Paste HTML containing one simple table.
  2. Confirm the first row contains unique field names.
  3. Check every output row against the visual table.
  4. Resolve merged cells, nested tables, and multirow headers before using the JSON.

Quick example

Example input

<table><tr><th>Name</th><th>Role</th></tr><tr><td>Ada</td><td>Engineer</td></tr></table>

Expected result

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

rowspan and colspan are expanded into a rectangular grid, but duplicate or multirow headers can still be ambiguous.

Best use cases

  • Extract a small documentation table.
  • Turn a simple copied table into JSON records.
  • Prepare a rectangular table for manual data cleanup.

References and scope

HTML tables can represent merged and nested structures that a flat JSON object array cannot preserve automatically. This tool supports only a simple rectangular subset.

Sources checked July 24, 2026. Specifications and platform behavior can change; verify the sources before formal use.

Known limitations

  • The first expanded row is used as keys even when it contains td rather than th elements.
  • Only the first table is converted and nested table cells are excluded.
  • thead, tbody, and tfoot semantics are not preserved in JSON.

FAQ

Which table is converted?

Only the first table found in the pasted HTML; nested table cells are excluded.

Must the first row use th cells?

No. The implementation uses the first expanded row regardless, but meaningful unique headers are strongly recommended.

Are rowspan and colspan supported?

Yes. Merged cells are expanded across the rectangular output grid.

What happens with duplicate headers?

Later values can overwrite earlier values under the same object key.