Skip to main content
Convert2JSON
ConvertersBrowser processing

HTML Table to JSON Converter

Copy a table out of a page or a report and turn it into an array of JSON objects, one per row, keyed by the header cells.

Input

HTML
characters
0
lines
0
size
0 B

Options

Your data stays on your device.Parsing, conversion and code generation happen in this browser. Input is not uploaded to Convert2JSON servers.Privacy policy

About this tool

Tabular data has a habit of arriving as markup — pasted out of a wiki, exported by a reporting tool, or lifted from a page that has no API behind it. The structure is all there; it is just wrapped in tags that nothing downstream can read.

This converter reads the table the way a person does. Header cells become the object keys, each body row becomes an object, and cells merged with colspan or rowspan are expanded so every row ends up with the same fields — which is what stops a merged category column from silently shifting every value one place to the left.

Entities are decoded and tags inside cells are stripped, so a cell containing a link comes back as its text rather than as markup. Numbers and booleans are converted to real JSON types unless you turn that off.

How to use this tool

  1. Paste the HTML, including the table tags, or upload a saved page.

  2. If the document has more than one table, set the table number.

  3. Choose whether the first row is a header, and whether to infer numbers and booleans.

  4. Press Convert, then copy or download the JSON.

Key features

  • Header cells become object keys, with duplicates disambiguated
  • colspan and rowspan expanded so every row has the same fields
  • HTML entities decoded and tags inside cells stripped
  • Optional inference of numbers, booleans and nulls
  • Table picker for documents containing several tables
  • Ragged rows reported as a warning rather than silently padded

Example

A table with a header row

InputHTML

<table>
  <tr><th>sku</th><th>quantity</th></tr>
  <tr><td>TENT-2P</td><td>34</td></tr>
  <tr><td>LAMP-USB</td><td>210</td></tr>
</table>

OutputJSON

[
  { "sku": "TENT-2P", "quantity": 34 },
  { "sku": "LAMP-USB", "quantity": 210 }
]

Good to know

  • This is a table scanner, not a full HTML parser. It understands rows, cells and their spans; anything else in the markup is treated as text to strip.
  • Nested tables are not supported — a table inside a cell will have its markup stripped along with everything else in that cell.
  • Only one table is converted per run. Set the table number to pick a different one.
  • Leading zeros are kept as strings, because a value such as 007 is nearly always an identifier rather than a number.

Frequently asked questions

What happens to merged cells?

They are expanded. A cell spanning three columns produces the same value in three fields, and a cell spanning two rows appears in both. Without this, every row after a merge would be misaligned.

My table has no header row. Can I still convert it?

Yes. Turn off "First row is header" and the keys become column_1, column_2 and so on, with every row kept as data.

Why is my value a string when it looks like a number?

Only plain decimal numbers are converted. Anything with a leading zero, a currency symbol, thousands separators or exponent notation stays a string, because converting those would change the value.

Two of my columns have the same header. What happens?

JSON keys have to be unique, so the second becomes name_2, the third name_3, and so on. Nothing is dropped.

Your data stays on your device

Your data is processed locally in your browser and is not uploaded to our server. This page keeps working after you go offline, because there is nothing to send.