Skip to content
ToolPlankDEV
JSON Tools
100% In-Browser Execution

Updated:

HTML Table to JSON Converter

Paste HTML code or copy a table from a web page and get JSON as you type. This html table to json converter lists every table it finds, handles merged cells and repeated column names, and turns numbers and true or false into real JSON types. Nothing is uploaded.

Processing in browser...

Loading the tool. It runs entirely in your browser, so your data is never uploaded.

More free tools you may need next.

Quick Guide

How to use HTML Table to JSON

Simple step-by-step instructions to get the exact output you need.

  1. 01

    Paste the table

    Paste HTML code into the left box, or copy a table on a web page, Google Docs or Word and paste it. You can also paste a whole page's source or open an .html file. Example loads two tables.

  2. 02

    Pick the table

    The Tables found list shows every table with its row and column count and a small preview. Choose one, or All tables to get one JSON object with every table in it.

  3. 03

    Set the shape and the types

    JSON shape picks a list of objects, a list of lists, an object keyed by the first column or an object of columns. Keys says where the names come from, and Numbers and true/false turns text such as 1,200 into the number 1200. Merged cells and repeated headers have their own settings.

  4. 04

    Copy or download

    The JSON updates as you type. Press Copy JSON, or Download to save table.json. Notes under the editor list anything the tool had to decide for you.

How to convert an HTML table to JSON

To convert an html table to json, the tool reads the table cells, takes the header cells as the keys and writes one object per body row. Here is the first table of the Example, a team list with a thousands separator, a decimal and a yes or no column:

JSON
[
  {
    "Name": "Ada Lovelace",
    "Role": "Mathematician",
    "Seats": 1200,
    "Remote": "yes"
  },
  {
    "Name": "Linus",
    "Role": "Engineer",
    "Seats": 85.5,
    "Remote": "no"
  },
  {
    "Name": "Grace Hopper (admiral)",
    "Role": "Grace Hopper (admiral)",
    "Seats": "",
    "Remote": true
  }
]

Seats became numbers because 1,200 and 85.5 are plain numbers. Remote is true on the last row because the cell says true, while yes and no stay text, since they could mean different things in different tables. The last row used a merged cell, which is explained below. Links keep their text and lose the address.

Pasting a page or copying a table from a browser

You do not have to find the table code. Select a table on a web page, copy it and paste it into the box. The browser puts the table's HTML on the clipboard, and the tool uses that. You can also paste the full source of a page. Every table in it is listed in Tables found, including tables used for layout, so pick the one with your data. Scripts and styles in pasted HTML are never run.

If the pasted text has no table tags but is separated by tabs, as when you copy cells from a spreadsheet, it is read as a table. Respect the terms of the site you copy from.

Four JSON shapes

A list of objects is the usual choice for APIs and code. The others suit different jobs. The same two-row table gives these results:

JSON
// List of lists
[["Name","Age"],["Ada",36],["Linus",55]]

// Object of columns
{"Name":["Ada","Linus"],"Age":[36,55]}

// Object keyed by the first column
{"Ada":{"Age":36},"Linus":{"Age":55}}

A keyed object is a lookup table, so the first column should be unique. If it is not, repeated values get _2, _3 and so on, and a note says so. Object keys in JavaScript that look like whole numbers, such as 2026, are moved to the front when the JSON is read by a program. That is how the language orders keys and not something the tool changes in the text.

Tables with no header, or two header rows

Keys set to From the header cells uses the cells inside thead or the cells written as th. If the table has none of those, the first row is used and a note says so. From the first row always uses the first row. Generate column1, column2 ignores the text and treats every row as data, which is the right choice for a table with no header at all.

When a table has two header rows, such as a Sales cell spanning Q1 and Q2 above them, the parts are joined with a space. That table gives the keys Sales Q1 and Sales Q2, so no information in the top row is lost. Empty header cells are named column1, column2 and so on by their position.

Merged cells: rowspan and colspan

A cell that spans several rows or columns would shift every later value left if it were read as one cell. The tool places each cell on a grid first, so merged cells keep the columns aligned. Merged cells set to Repeat the value copies the text into every cell it covers. Leave the others empty puts the text in the first cell only. For a table where a cell spans two rows and a last row has one cell spanning both columns, the two settings give:

JSON
// Repeat the value
[{"A":"x","B":1},{"A":"x","B":2},{"A":"wide","B":"wide"}]

// Leave the others empty
[{"A":"x","B":1},{"A":"","B":2},{"A":"wide","B":""}]

Repeated column names and key style

Two columns can have the same header, and a JSON object cannot hold the same key twice. Many converters let the second column overwrite the first, and the data is lost without a warning. Here Repeated headers adds _2, _3 and so on by default, so tag and tag become tag and tag_2. Group into a list instead gives one key with a list of the values:

JSON
[{"tag":["a","b"],"n":1}]

Key style can rewrite the header text as camelCase, snake_case or lowercase. First Name becomes firstName or first_name. Characters that are not letters or digits count as word breaks, so a header such as Total ($) becomes total in snake_case.

How numbers, booleans and empty cells are typed

  • Numbers: with the US format, 1,200 and -3.5 become numbers and 1,2 stays text. With 1.234,56 selected, 1.200,5 becomes 1200.5.
  • Leading zeros: 007 stays text, so codes and ZIP codes are not changed. 0.5 and 0 are numbers.
  • Long numbers: a value with more than 15 digits stays text, because JSON numbers cannot hold it exactly.
  • Booleans: true and false, in any capitals, become booleans. Yes, no, on and off stay text.
  • Empty cells: write empty text, null, or leave the key out of that object.
  • Percent and currency signs such as 50% and $5 stay text, because turning them into numbers would drop the unit.

Turn off Numbers and true/false to keep every value as text, which is the safest choice when you will do the typing yourself in code.

Limits and privacy

A table can have at most 200,000 body rows. Larger input is refused with a message. The tool works from the table markup only. It does not read data loaded by scripts after a page opens, so view the source of such a page only after the table is in the page, or copy the table from the rendered page. Cell text is kept, but links, images and formatting are not.

Everything runs in your browser. The HTML is not sent to a server and is not stored. See the Privacy Policy for details.

To build a table from JSON, use JSON to HTML Table. If you need a spreadsheet file, HTML Table to CSV writes CSV, and HTML Table to Markdown writes a README table. CSV to HTML Table goes the other way, and JSON Schema Generator can describe the JSON you get here.

Frequently Asked Questions

Technical Q&A for HTML Table to JSON

Common questions about edge cases, character encoding, and privacy guarantees.

Paste the table's HTML, or copy the table from a web page and paste it, and the JSON appears on the right. Header cells become the keys and each body row becomes an object.

Yes. Every table in the page is listed in Tables found. Pick one, or choose All tables to get one JSON object with each table under its caption or table1, table2.

With Keys on From the header cells, the first row is used as the keys and a note says so. Choose Generate column1, column2 to treat every row as data.

Each merged cell is placed on a grid, so the columns stay aligned. The value is repeated in every cell it covers, or kept in the first one only, as you choose.

They are kept apart as tag and tag_2 by default, so nothing is overwritten. You can group them into one key with a list of values instead.

Yes, and you can switch it off. Plain numbers such as 1,200 and 85.5 become numbers, and true and false become booleans. Values with leading zeros, such as 007, stay text.

Select the table on the page, copy it, and paste it into the box. If the table is built by scripts, copy it from the rendered page and not from the page source.

You can paste the JSON into a flow as sample or fixed data. The tool does not connect to Power Automate or any other service. It only converts the text you give it.

Yes. Set JSON shape to Object keyed by first column. The first column's values become the keys, and repeated values get _2, _3 and so on.

No. The HTML is read as text in your browser. Scripts in it never run, and nothing is sent to a server.