JSON to HTML Table Converter Online – Free, No Upload

Paste a JSON array and convert JSON to an HTML table in your browser. The text stays on this page and is not uploaded.

JSON input

HTML table output

Convert JSON to see HTML table markup here.

Live table preview

Convert JSON to see a rendered table here.

Quick answer

Paste a JSON array of objects and convert it to an HTML table. Headers are the union of all keys in first-seen order. Missing keys leave an empty cell. For this input:

[
  {"name": "Ayesha", "age": 28, "city": "Karachi"},
  {"name": "Bilal", "age": 34, "city": "Lahore", "plan": "Pro"}
]

the markup (2-space indent, thead and tbody on) is:

<table>
  <thead>
    <tr>
      <th scope="col">name</th>
      <th scope="col">age</th>
      <th scope="col">city</th>
      <th scope="col">plan</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Ayesha</td>
      <td>28</td>
      <td>Karachi</td>
      <td></td>
    </tr>
    <tr>
      <td>Bilal</td>
      <td>34</td>
      <td>Lahore</td>
      <td>Pro</td>
    </tr>
  </tbody>
</table>

What this converter does

It turns a JSON array of objects into HTML table markup for a web page, an email, or a report. Conversion runs in this browser with JSON.parse. The JSON is not uploaded.

Use it when you have API data, a spreadsheet export as JSON, or a list of records and you need a table you can paste into HTML. Format the JSON first in the JSON Formatter or inspect it in the JSON Viewer if you need to read the structure before converting.

This page converts JSON to HTML tables only. It does not write Markdown or CSV. For a spreadsheet file, use the JSON to CSV converter. For XML instead of a table, use the JSON to XML converter.

How to convert JSON to an HTML table

Step 1: Add JSON

Paste JSON into the editor, choose Open JSON File, or choose Load Sample JSON. Open JSON File converts as soon as a valid file is read. Load Sample JSON converts immediately.

Step 2: Choose options

Keep flatten nested keys on for dotted columns such as address.city. Keep thead and tbody on unless you need a bare table. Add an optional caption or CSS class, and pick 2-space or 4-space indentation.

Step 3: Convert pasted JSON

Pasted JSON needs Convert to HTML. Invalid JSON stays in the editor. The status line explains the problem in plain language, and the table preview is cleared.

Step 4: Copy or download

Copy HTML converts the current editor text, then copies that markup. Download HTML converts the current editor text and saves table.html. Neither button copies a stale preview. Clear empties both panels.

How JSON maps to a table

An array of objects becomes one row per object. The headers are the union of all keys, in first-seen order. Each key becomes a <th scope="col"> header.

Nested objects become dotted columns

With flatten nested keys on (the default), nested objects become dotted columns. {"user": {"name": "Ayesha", "address": {"city": "Karachi"}}} becomes the columns user.name and user.address.city.

Arrays stay in one cell

Arrays of plain values are joined with semicolons in one cell. Arrays of objects are shown as compact JSON in one cell.

Missing keys leave an empty cell

If one object has a key that another object does not, the column still appears. The missing cell is empty.

A single object is one row

A JSON object that is not wrapped in an array is treated as a one-row table. A root that is neither an array nor an object fails with a plain-language error before any markup is produced.

Escaping and safety

Every key and value is HTML-escaped. &, <, >, quotes and apostrophes become entities, so markup inside the data shows as text and cannot run. A value like <img onerror=…> appears as text in the cell; it is not inserted as live HTML.

Options

Flatten nested keys

On by default. Nested objects become dotted columns such as address.city. Turn it off to keep a nested object as compact JSON in one cell.

Include thead and tbody

On by default. The header row is wrapped in <thead> and the data rows in <tbody>. Turn it off for a table with only <tr> rows.

Caption

Optional. When filled, the converter adds a <caption> as the first child of the table.

CSS class

Optional. Adds a class to the <table> so you can hook Bootstrap, Tailwind, or your own stylesheet.

Indentation

2 spaces (default) or 4 spaces in the generated markup.

Worked example

Input:

[
  {"name": "Ayesha", "age": 28, "city": "Karachi"},
  {"name": "Bilal", "age": 34, "city": "Lahore", "plan": "Pro"}
]

Output with 2-space indentation, thead and tbody on, and no caption or class:

<table>
  <thead>
    <tr>
      <th scope="col">name</th>
      <th scope="col">age</th>
      <th scope="col">city</th>
      <th scope="col">plan</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Ayesha</td>
      <td>28</td>
      <td>Karachi</td>
      <td></td>
    </tr>
    <tr>
      <td>Bilal</td>
      <td>34</td>
      <td>Lahore</td>
      <td>Pro</td>
    </tr>
  </tbody>
</table>

Headers are the union of all keys in first-seen order: name, age, city, plan. The first record has no plan, so its cell is empty. Flattening example: {"user": {"name": "Ayesha", "address": {"city": "Karachi"}}} becomes the columns user.name and user.address.city.

Frequently asked questions

How do I convert JSON to an HTML table?

Paste a JSON array of objects. The converter writes a table with one row per object and one column per key. Copy the markup into your page.

What if my JSON is a single object, not an array?

The converter treats one object as a one-row table — you do not need to wrap it in square brackets yourself.

How are nested objects handled?

They are flattened into dotted columns. {"address": {"city": "Karachi"}} becomes the column address.city.

What happens to missing keys?

The cell stays empty. The column still appears, because the headers are the union of all keys across every object.

Is the HTML escaped?

Yes. &, <, >, quotes and apostrophes are escaped, so markup inside your data shows as text and cannot run.

Can I style the table?

Yes. Add a CSS class (for example for Bootstrap or Tailwind) and a caption; the markup is plain and ready to style with your own CSS.

Is my JSON uploaded?

No. The conversion runs entirely in your browser with JavaScript — your JSON is never sent to a server, logged or stored.

What if my JSON is invalid?

The converter tells you in plain language (e.g. a missing comma or an unquoted key) and produces no table until the JSON parses. Fix the input, then convert again.

Disclaimer

Free tool, runs entirely in your browser. Nothing you paste is uploaded or stored.