JSON to HTML Table Converter – Free & Instant

Convert JSON arrays to clean HTML table markup in seconds. Free, browser-based — nothing uploaded. Paste your JSON, copy the <table> code, done.

JSON
111 chars · 4 lines · 111 bytes
HTML

Turn JSON data into a clean HTML table in seconds

Paste your JSON array and get a properly formatted HTML table you can drop straight into any webpage, email template, or CMS. No spreadsheet software, no manual markup — just copy in, copy out.

Quick conversion — JSON to HTML table: paste your JSON array above, click Convert, then copy or download the resulting <table> markup. The tool auto-detects column names from your object keys and handles numbers, strings, and nulls correctly. Everything runs in your browser — your data is never uploaded anywhere.

Example input (2 rows):
[{"name":"Alice","age":30},{"name":"Bob","age":25}]
Resulting HTML table output:
<table>
  <thead><tr><th>name</th><th>age</th></tr></thead>
  <tbody>
    <tr><td>Alice</td><td>30</td></tr>
    <tr><td>Bob</td><td>25</td></tr>
  </tbody>
</table>

How to use this JSON to HTML table converter

  1. Paste your JSON — drop a JSON array (a list starting with [) into the input box above.
  2. Click Convert — the tool reads your object keys as column headers and maps every value to the right cell.
  3. Copy or download — grab the <table> HTML and paste it wherever you need it.

If your JSON has extra whitespace or is minified (squeezed onto one line), the converter handles both fine. You can also paste and validate your JSON first with the JSON Validator if you want to catch errors before converting.

Worked example — product catalog

Say you have a small product list from an API response:

[
  { "product": "Widget A", "price": 9.99, "in_stock": true },
  { "product": "Widget B", "price": 14.50, "in_stock": false },
  { "product": "Widget C", "price": 4.00, "in_stock": true }
]

Paste that in and click Convert. The output is a ready-to-use HTML table:

<table>
  <thead>
    <tr>
      <th>product</th>
      <th>price</th>
      <th>in_stock</th>
    </tr>
  </thead>
  <tbody>
    <tr><td>Widget A</td><td>9.99</td><td>true</td></tr>
    <tr><td>Widget B</td><td>14.50</td><td>false</td></tr>
    <tr><td>Widget C</td><td>4.00</td><td>true</td></tr>
  </tbody>
</table>

Add a CSS class or a style attribute to the <table> tag to match your site's design. The structure is standard HTML, so it works in every browser and email client that supports tables.

How to convert JSON to an HTML table in code

If you need this in a script or build pipeline, here is the simplest approach in two popular languages.

JavaScript (browser or Node.js)

// JavaScript
function jsonToHtmlTable(jsonArray) {
  if (!jsonArray.length) return '';
  const headers = Object.keys(jsonArray[0]);
  const headerRow = headers.map(h => `<th>${h}</th>`).join('');
  const bodyRows = jsonArray.map(row =>
    '<tr>' + headers.map(h => `<td>${row[h] ?? ''}</td>`).join('') + '</tr>'
  ).join('\n');
  return `<table><thead><tr>${headerRow}</tr></thead><tbody>\n${bodyRows}\n</tbody></table>`;
}

const data = [{name:'Alice',age:30},{name:'Bob',age:25}];
console.log(jsonToHtmlTable(data));

Python

# Python 3
import json

def json_to_html_table(json_array):
    if not json_array:
        return ''
    headers = list(json_array[0].keys())
    header_row = ''.join(f'<th>{h}</th>' for h in headers)
    body_rows = ''.join(
        '<tr>' + ''.join(f"<td>{row.get(h, '')}</td>" for h in headers) + '</tr>'
        for row in json_array
    )
    return f'<table><thead><tr>{header_row}</tr></thead><tbody>{body_rows}</tbody></table>'

with open('data.json') as f:
    data = json.load(f)
print(json_to_html_table(data))

Both snippets assume a flat array of objects (each object is one row). For nested JSON, flatten it first — see the 'nested JSON' FAQ entry below.

How it works

The converter reads your JSON array and uses the keys of the first object as column headers (<th> elements). Each object in the array becomes a <tr>, and each value becomes a <td>. Numbers stay as numbers; booleans appear as true or false; null becomes an empty cell.

The resulting markup follows the standard HTML table structure — <table>, <thead>, <tbody>, <tr>, <th>, <td> — as defined in the WHATWG HTML Living Standard for tables. All processing happens client-side in JavaScript; nothing leaves your device.

When to use this tool (and when not to)

Good fit ✅ Not the right tool ❌
Flat JSON arrays (list of objects) Deeply nested JSON (flatten it first)
Displaying API responses as readable data grids A single JSON object (not an array)
Dropping tables into HTML emails or CMS pages Interactive sortable tables (add JS sorting after)
Quick prototyping or documentation Very large datasets — paste a sample instead

Related tools you might need

  • Got messy or minified JSON? Run it through the JSON Beautifier first to make it readable.
  • Need to shrink your JSON for an API payload? Try the JSON Minifier.
  • Getting a parse error? The JSON Validator pinpoints exactly where your JSON breaks.
  • Just want to browse and inspect your data? Open it in the JSON Viewer for a collapsible tree view.
  • Need a readable, indented copy? JSON Pretty Print formats it with correct spacing in one click.
  • Converting to a config format? The JSON to YAML Converter has you covered.

Your data never leaves the browser — the entire conversion happens locally in JavaScript, so sensitive records stay private. Paste your JSON above and get your HTML table instantly.

Frequently asked questions

My JSON is valid but the table looks wrong — what happened?+
The converter expects a JSON array of objects, like [{...},{...}]. If you paste a single object ({...}) or an array of arrays ([[...],[...]]), the output may be empty or garbled. Wrap a single object in square brackets to make it a one-row array, then try again.
How do I convert nested JSON to an HTML table?+
Nested JSON (objects inside objects) doesn't map directly to table rows. The easiest fix is to flatten it first — in JavaScript, use a small helper that spreads nested keys into dot-notation names (e.g. address.city), then run the flattened array through this tool. For Python, pandas.json_normalize() does the same job in one line.
Is my data uploaded to a server or stored anywhere?+
No. Everything runs in your browser with JavaScript. Your JSON is never sent to any server, logged, or stored. You can even use this tool with the network tab open and confirm zero upload requests.
Is the tool free? Do I need an account?+
Completely free, no sign-up required. Open the page, paste your JSON, and convert — that's it.
Can it handle large JSON files?+
It works well for typical API responses and moderate-sized datasets. For very large files (thousands of rows), browser performance depends on your device. Paste a representative sample to test your output first, then run the full file if it's fast enough.
How do I add CSS styling to the HTML table output?+
The output is plain, unstyled HTML — intentionally, so it fits any design system. Add a class attribute to the <table> tag (e.g. class='my-table') and target it in your stylesheet, or add inline style attributes. Bootstrap users can add class='table table-striped' for instant styling.
What's the difference between converting JSON to an HTML table versus converting it to a Markdown table?+
An HTML table uses <table> tags and renders in any browser or email client — best for web pages and HTML emails. A Markdown table uses pipe characters (|) and is for README files, wikis, or any Markdown-rendered environment like GitHub. This tool produces HTML; most Markdown editors won't render raw HTML table tags.
Can I use this to display a JSON API response as a table in my webpage?+
Yes, that is the most common use case. Fetch your API data, paste the JSON array here, and paste the resulting <table> HTML into your template. If the data updates frequently, use the JavaScript snippet on this page to generate the table dynamically instead.