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

Updated:

JSON to HTML Table Converter

Paste JSON and get an HTML table with a live preview beside the code. This json to html table converter handles nested objects and lists, picks the rows out of an API response, and can write inline styles that email apps keep. 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 JSON to HTML Table

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

  1. 01

    Paste your JSON

    Paste JSON into the left box, press Paste to read the clipboard, or drop a .json file on it. Example loads an API-style response with a nested address and a list of tags.

  2. 02

    Choose how nested data appears

    Nested data decides what happens to an object or list inside a value: a small table or list in the cell, extra columns named by path, or JSON text. Style picks bare HTML, simple or striped CSS, or inline styles for email.

  3. 03

    Check the preview

    The HTML code and a rendered preview update as you type. Notes below the editor say which part of the JSON became the rows, how many keys were missing and what was done with nested values.

  4. 04

    Copy or download

    Press Copy HTML to paste the table into a page or an email, or Download to save a complete table.html file.

How to convert JSON to an HTML table

To convert json to an html table, paste an array of objects. Each object becomes a row, and each key becomes a column. The tool collects the keys from every object, so a key that appears in only some rows still gets its own column. Take this JSON:

JSON
[{"name":"Ada","age":36},{"name":"Linus","age":55}]

With Bare HTML and the caption People, the result is:

HTML
<table>
  <caption>People</caption>
  <thead>
    <tr>
      <th scope="col">name</th>
      <th scope="col">age</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Ada</td>
      <td>36</td>
    </tr>
    <tr>
      <td>Linus</td>
      <td>55</td>
    </tr>
  </tbody>
</table>

The status line reads 2 rows and 2 columns. Values are escaped, so a string such as <b> is shown as text and never becomes markup in your page.

Which part of the JSON becomes the table

A real API response is usually an object that wraps the list, such as a status field next to an array called data. When the object has exactly one list of objects, or one under a common name such as data, items, results or rows, that list is used and a note says so. To pick another part, type a path in More options under Rows from, for example data.items or results[0].rows.

  • An array of objects gives one row per object.
  • An array of arrays gives one row per inner list. If the first list is all text and there is more than one list, it becomes the header row.
  • An array of plain values gives a single column named value.
  • One object gives a two-column table of keys and values.
  • An object whose values are all objects gives one row per key, with the key in a first column named key.
  • JSON Lines, one JSON value per line, is read as an array.

Nested objects and lists: sub-tables, columns or JSON text

Most JSON found online is nested, and a table cell can hold only one thing. The Nested data setting gives three ways to handle it. Here is one row with an address object, a list of tags and a list of orders:

JSON
[{"id":1,"address":{"city":"London","zip":"N1"},"tags":["a","b"],"orders":[{"sku":"X","qty":2},{"sku":"Y","qty":1}]}]

Sub-tables and lists writes the address as a small two-column table, the tags as a bullet list and the orders as a table with sku and qty columns, all inside the cell:

HTML
<td><table><tbody><tr><th>city</th><td>London</td></tr><tr><th>zip</th><td>N1</td></tr></tbody></table></td>
<td><ul><li>a</li><li>b</li></ul></td>
<td><table><thead><tr><th>sku</th><th>qty</th></tr></thead><tbody><tr><td>X</td><td>2</td></tr><tr><td>Y</td><td>1</td></tr></tbody></table></td>

Flatten into columns keeps the table flat. The columns become id, address.city, address.zip, tags, orders.0.sku, orders.0.qty, orders.1.sku and orders.1.qty. A list of plain values such as the tags is joined with commas into one cell. Keep as JSON text writes the nested value as escaped JSON, which is the simplest and the least readable. Nesting deeper than six levels in sub-table mode, or twenty in flatten mode, is written as JSON text.

JSON to HTML table for email, with inline styles

Many email programs drop a style block from a message, and a bare table then shows no borders. The Email, inline styles preset puts the styling on every tag, so the table does not depend on a style block. The first body row of a two-column table looks like this:

HTML
<tr>
  <td style="border:1px solid #d0d5dd;padding:8px 12px;text-align:left;">Ada</td>
  <td style="border:1px solid #d0d5dd;padding:8px 12px;text-align:right;">36</td>
</tr>

If you build the message in an automation or a mail-merge tool, paste the code into the HTML part of the body. Email programs differ, so send yourself a test message first. No converter can promise how every program will draw a table.

Styles, headers and number alignment

Bare HTML writes only the table, for a site that has its own CSS. Simple CSS adds a short style block with borders and padding, and Striped CSS shades every other row. The block uses a class name, data-table by default, so it does not affect other tables on the page. You can change the class name under More options.

  • Header row writes the keys inside thead with scope=col, which screen readers use to announce each column.
  • First column is a row header writes the first cell of each row as th with scope=row, which suits tables where each row has a name.
  • Right-align numbers aligns a column on the right when every value in it is a JSON number. A column that mixes numbers and text stays left-aligned.
  • Null values can be an empty cell, the word null or a dash. A key that is missing from a row is always an empty cell.
  • Columns takes a comma list such as id, name to keep only those columns, in that order.

When the JSON does not parse

If the JSON is invalid, the output panel shows the line and column of the first problem and, where the cause is common, a hint such as a missing comma or a single-quoted string. Allow comments and trailing commas in More options reads JSON5-style input by ignoring comments and a comma before a closing bracket. Single quotes and unquoted keys are not accepted.

Numbers are read as ordinary 64-bit floating point numbers. An integer with more than 15 digits, such as a long ID, may lose its last digits, and the tool adds a note when it sees one. Store such IDs as strings in the JSON to keep them exact.

Limits and what stays on your device

A table can have at most 200,000 rows, 2,000 columns and 1,000,000 cells. Past that, the tool tells you to narrow the data with Rows from or Columns. The preview shows the first 200 rows, while Copy and Download include every row.

Your JSON is read and turned into HTML in this browser tab. It is not sent to a server. The preview runs in a sandboxed frame that cannot run scripts. See the Privacy Policy for how the site handles data.

To go the other way, HTML Table to JSON reads a table from HTML and returns typed JSON. For spreadsheet data, CSV to HTML Table builds the same kind of table from CSV, and HTML Table to CSV extracts one. JSON to Excel writes a workbook instead, and JSON Lines Viewer is a better fit for large logs.

Frequently Asked Questions

Technical Q&A for JSON to HTML Table

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

Paste the JSON into the left box and the table code appears on the right. An array of objects gives one row per object and one column per key. Press Copy HTML to take it.

By default each one becomes a small table or list inside its cell. You can instead flatten nested keys into columns such as address.city, or keep the value as JSON text, with the Nested data setting.

Use the Email, inline styles preset, which puts the styling on each tag instead of in a style block. Email programs draw HTML differently, so send a test message first.

The tool uses the single list of objects in the response, or one named data, items, results or rows. To choose another part, type its path, such as data.items, under Rows from in More options.

Every key found in any object becomes a column. An object that lacks a key gets an empty cell there, and a note tells you how many cells were empty for that reason.

Yes. One JSON value per line is read as a list. Turn on Allow comments and trailing commas for input that has comments or a comma before a closing bracket.

Columns follow the order in which keys first appear. JavaScript puts keys that look like whole numbers, such as 10 or 2, before other keys. To set the order yourself, list the names under Columns.

Yes. Type the names under Columns in More options, separated by commas. The table shows those columns in that order, and a note lists any name that was not found.

Not above 15 digits. JSON numbers are read as 64-bit floats, so very long integers can lose their last digits. Put such IDs in quotes in the JSON, and they stay exact.

No. The JSON is converted in your browser and is not sent to a server, and the preview runs in a sandboxed frame.