Paste JSON and get a clean HTML table as you type, ready to drop into a page or email.
Paste JSON, upload a .json file or drop one here.
Updates as you type. Copy the markup or download table.html.
Converting…
This free JSON to HTML table converter turns an array of objects, a single object or a plain list of values into a <table> you can paste straight into a web page, an email template or a CMS. Paste the JSON on the left and the markup appears on the right, with a header row, one row per record and every special character escaped. Nothing is installed, and because the conversion runs in your browser, the data is never uploaded.
It is a quick way to preview an API response as a readable grid, to put exported data into documentation, or to hand a non-developer a table they can open in any browser. If you only need to view data, a table is often easier to scan than a screen of braces; if you need the data in a spreadsheet, the JSON to CSV converter is the better fit.
.json file. You can also drag a file onto the editor.table.html.The first record has a tags array and no email; the second has an email and no tags. The converter gives both rows the same four columns, leaves the missing cells empty, turns the array into an inner table and escapes the angle brackets and ampersand in the second name.
[
{
"id": 1,
"name": "Ada Lovelace",
"tags": ["admin", "dev"]
},
{
"id": 2,
"name": "<Bob> & Co",
"email": "bob@example.com"
}
]<table>
<thead>
<tr>
<th scope="col">id</th>
<th scope="col">name</th>
<th scope="col">tags</th>
<th scope="col">email</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Ada Lovelace</td>
<td>
<table>
<tbody>
<tr>
<td>admin</td>
</tr>
<tr>
<td>dev</td>
</tr>
</tbody>
</table>
</td>
<td></td>
</tr>
<tr>
<td>2</td>
<td><Bob> & Co</td>
<td></td>
<td>bob@example.com</td>
</tr>
</tbody>
</table>| JSON | HTML output | Notes |
|---|---|---|
| Array of objects | A header row (th) plus one tr per object | Columns are the union of all keys, in the order they first appear. |
| Single object | Two columns, Key and Value | Each key is a <th scope="row"> cell. |
| Array of strings, numbers or booleans | One column headed Value | One row per item. |
| Mixed array, or array of arrays | One column, one row per item | Nested items follow the Nested values option. |
null | Empty cell | A missing key looks the same as null. |
| Number or boolean | Plain text | true, 1.5, 1e+21 |
| Empty object or array | {} or [] in a code element | Never an empty inner table. |
JSON records often differ: a field appears on some objects and not others. Rather than guessing from the first row, the converter reads every object and builds the header from all the keys it finds, in first-seen order. A record without a given key gets an empty cell, so the columns always line up. If the JSON is a single object, or the array holds anything other than objects, you get the Key and Value layout or the single Value column shown above. A bare string, number or empty document is rejected, because there is nothing to lay out as a table.
Real API responses are rarely flat. With Nested tables (the default), an object inside a cell becomes a small key/value table and an array of objects becomes a table of its own, so nothing is lost and the structure stays visible. Choose JSON text when you want one tidy row per record: the nested value is written as compact JSON inside a code element, with its quotes escaped.
Keys and values are treated as text, never as markup. The characters &, <, >, " and ' are replaced with HTML entities, so a value such as <script>alert(1)</script> is displayed literally. That matters when the JSON comes from user input or a third-party API and the table ends up on a page.
By default you get just the table element with no inline styles and no classes, so it inherits the CSS of whatever page it is pasted into. Tick Full HTML page and the table is wrapped in a minimal <!doctype html> document with a small embedded stylesheet (borders, padding and a shaded header), which is handy for a downloaded preview. Email clients often strip or ignore style blocks, so for email start from the table-only output and add the inline styles your template needs. The optional caption becomes the table's caption element and, on a full page, the document title.
Need data to try it with? Generate a realistic array with the JSON Generator. To describe the structure of what you are showing, use the JSON Schema Generator, or convert the same data with the JSON to Excel converter or the JSON to CSV converter.
Paste your JSON into the JSON Input editor, or upload a .json file. The HTML table appears in the output editor as you type. Copy the markup, or click Download to save it as table.html.
For an array of objects, each object becomes a row and the columns are all the keys that appear anywhere in the array, in the order they are first seen. If an object lacks a key, or the value is null, its cell is left empty.
By default each nested object or array is rendered as a small table inside its cell. Switch Nested values to JSON text if you would rather show it as compact JSON inside a code element. Empty objects and arrays are always shown as {} and [].
Every key and value is HTML-escaped, so text such as <script> or a stray ampersand is shown literally and cannot add markup. The table-only output contains no inline styles or scripts.
Yes. Tick Full HTML page to wrap the table in a minimal HTML5 document with a small embedded stylesheet, so it looks tidy when you open the downloaded table.html in a browser. Leave it off when you only want the table to paste into an existing page.
No. The conversion runs entirely in your browser with JavaScript, so your data never leaves your device. That makes it fine for API responses and exports that contain private values.