Nested objects become dotted column names, a row that lacks a key gets an empty cell, and a number with more than 15 significant digits is copied exactly as written.
HTML table markup
Rendered preview
Turn JSON into an HTML table or a Markdown table in your browser: nested keys flattened, every cell escaped.
Nested objects become dotted column names, a row that lacks a key gets an empty cell, and a number with more than 15 significant digits is copied exactly as written.
Rendered preview
A JSON to HTML table converter turns JSON data into table markup that you can paste into a web page, a CMS or an email template, and into a Markdown table for a README, a wiki or a pull request. This page takes an array of objects, a single object, an array of arrays or a plain list of values, flattens nested objects into dotted column names, and writes both versions from the same flattening code as the JSON to CSV converter. Every value is escaped before it goes into the markup, so text such as <script> stays visible text instead of running. You choose whether there is a header row, whether the rows sit inside thead and tbody, a class and an id for your own CSS, and how the code is indented. Large files are converted in a background worker, so the page stays responsive.
Paste your JSON into the box, choose a .json file, or load the sample. The HTML table and a rendered preview appear on the right as soon as the JSON is valid. Switch to the Markdown tab for a Markdown table instead. Change an option to update the result, then copy it or download it.
If the table is meant for a spreadsheet instead, the JSON to CSV converter and the JSON to Excel converter use the same flattening rules, so the same data gives the same columns in every format.
Every item in the array becomes one table row. Nested objects are flattened with dot notation, so {"address": {"city": "London"}} becomes a column named address.city. The columns are the union of every key in every row, in the order they first appear, and a row that lacks a key gets an empty cell. The table is always flat: there are no merged cells and no tables inside tables.
| In the JSON | In the table |
|---|---|
A nested object, such as {"a": {"b": 1}} | A column named a.b holding 1 |
| An array of plain values, with the Join option (the default) | One cell, the values separated by "; " (you can pick another separator), for example math; poetry |
| An array of plain values, with Indexed columns | One column per position: tags.0, tags.1, and so on |
| An array that holds objects or other arrays, with the Join option | The array kept as compact JSON text in one cell, with a notice. Indexed columns flatten it instead, as in lines.0.sku |
| Any array, with Keep as a JSON string | The compact JSON text of the array in one cell |
| An empty array or an empty object | An empty cell for an empty array with Join, otherwise []; an empty object is written as {} |
null or a key that is missing from a row | An empty cell, <td></td> in HTML. The two look the same in the table |
true and false | The text true and false |
| A number | The number as JavaScript writes it, such as 24.5 or -3. A number with more than 15 significant digits is copied exactly as it appears in your JSON, and a warning says so |
| Text with <, >, & or quotes | Escaped, so it shows as text. See the escaping table below |
| Text with a line break | A br tag in HTML (you can turn this off) and always a br tag in Markdown |
Two different keys can flatten to the same column name, for example a key that is literally called a.b and a nested object a with a key b. When that happens the later value wins and a warning counts the values that were overwritten. A list of plain values gets one column named value, a single object is one row, and an array of arrays is written row by row with the columns named column_1, column_2 and so on.
This input has rows with different keys, a nested object, an empty array, a null, and a value with markup in it. The HTML and the Markdown below are the exact output of this page with the default options, copied from the running tool.
JSON input
[
{
"id": 1,
"name": "Ada Lovelace",
"address": {
"city": "London",
"zip": "02134"
},
"tags": [
"math",
"poetry"
]
},
{
"id": 2,
"name": "Grace Hopper",
"address": {
"city": "New York"
},
"tags": [],
"note": null
},
{
"id": 3,
"name": "Zoë Müller",
"tags": [
"go"
],
"note": "Likes <b>bold</b> & tea"
}
]
HTML table output
<table>
<thead>
<tr>
<th scope="col">id</th>
<th scope="col">name</th>
<th scope="col">address.city</th>
<th scope="col">address.zip</th>
<th scope="col">tags</th>
<th scope="col">note</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Ada Lovelace</td>
<td>London</td>
<td>02134</td>
<td>math; poetry</td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>Grace Hopper</td>
<td>New York</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>Zoë Müller</td>
<td></td>
<td></td>
<td>go</td>
<td>Likes <b>bold</b> & tea</td>
</tr>
</tbody>
</table>
Markdown table output
| id | name | address.city | address.zip | tags | note | | --- | --- | --- | --- | --- | --- | | 1 | Ada Lovelace | London | 02134 | math; poetry | | | 2 | Grace Hopper | New York | | | | | 3 | Zoë Müller | | | go | Likes <b>bold</b> & tea |
The address.city and address.zip columns come from the nested object. The second row has a city but no zip, and the third row has no address at all, so both give empty cells. The empty tags array in row 2 and the null note give empty cells too, which is why the null and the missing key look the same. The third note contains the characters < and &, which are written as < and & in the HTML so a browser shows them as text. The zip 02134 keeps its leading zero because it is text in the JSON. The header cells carry scope="col", which helps screen readers.
Values from an API are not always friendly. This input holds a script tag, quotes, an ampersand, a pipe, a backslash and a line break. Nothing in it can run, because the HTML writer escapes it and the Markdown writer neutralises the characters that matter in a pipe table.
JSON input
[
{
"comment": "<script>alert(1)</script>",
"quote": "She said \"hi\" & left",
"code": "a | b",
"path": "C:\\temp",
"text": "line one\nline two"
}
]
HTML table output
<table>
<thead>
<tr>
<th scope="col">comment</th>
<th scope="col">quote</th>
<th scope="col">code</th>
<th scope="col">path</th>
<th scope="col">text</th>
</tr>
</thead>
<tbody>
<tr>
<td><script>alert(1)</script></td>
<td>She said "hi" & left</td>
<td>a | b</td>
<td>C:\temp</td>
<td>line one<br>line two</td>
</tr>
</tbody>
</table>
Markdown table output
| comment | quote | code | path | text | | --- | --- | --- | --- | --- | | <script>alert(1)</script> | She said "hi" & left | a \| b | C:\\temp | line one<br>line two |
In the HTML the script tag is plain text, the quotes and the ampersand are entities, and the line break became a br tag. In the Markdown a pipe becomes \| so it does not end the cell, a backslash is doubled, a < becomes < so the cell cannot start an HTML tag, and the line break is a br tag because a Markdown table cell cannot hold a real line break.
A single object becomes one row. The array of items is the only part that depends on your choice. Here is the input, then the Markdown table for each option. The HTML table has the same cells.
JSON input
{
"order": "A-1001",
"items": [
"pen",
"ink",
"pad"
],
"ship": {
"to": "Oslo",
"express": true
}
}
Output with Join the values into one cell (the default)
| order | items | ship.to | ship.express | | --- | --- | --- | --- | | A-1001 | pen; ink; pad | Oslo | true |
Output with Indexed columns
| order | items.0 | items.1 | items.2 | ship.to | ship.express | | --- | --- | --- | --- | --- | --- | | A-1001 | pen | ink | pad | Oslo | true |
Output with Keep as a JSON string
| order | items | ship.to | ship.express | | --- | --- | --- | --- | | A-1001 | ["pen","ink","pad"] | Oslo | true |
Five characters are replaced in every header cell, every data cell, and in the class and id you type. Nothing else is changed, so accented letters, emoji and other Unicode text are written as they are.
| Character | Written as |
|---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
That is why the markup is safe to paste into a page: the only tags in it are the table, thead, tbody, tr, th, td and br tags that this tool writes, plus the class and id attributes you type. The preview on this page is built from the rows with text nodes, and your markup is never inserted into the page as HTML. The Markdown table is not sanitised for a particular renderer. A renderer decides what to do with characters such as * or [ in a cell, so if the data comes from someone you do not trust, render the Markdown with a renderer that sanitises its output.
The header row option applies to both outputs. With it off, the HTML has no header cells and the Markdown has an empty header line, because a Markdown table cannot exist without one. Wrap rows in thead and tbody is on by default; with it off, the rows sit directly inside the table, which is what some content systems expect. The class goes on the table element as typed, so table table-striped gives two classes, and spaces in the id are replaced by hyphens because an id cannot contain a space. Here is the same small input written with a class, an id, no thead and tbody and the default indentation:
JSON input
[{"city":"Oslo","temp":3},{"city":"Rome","temp":14}]
HTML table output with class "table table-striped", id "weather" and thead and tbody off
<table class="table table-striped" id="weather">
<tr>
<th scope="col">city</th>
<th scope="col">temp</th>
</tr>
<tr>
<td>Oslo</td>
<td>3</td>
</tr>
<tr>
<td>Rome</td>
<td>14</td>
</tr>
</table>
An array of arrays shows what the header row option does for data that has no keys. The columns are named column_1 and column_2 when the header row is on. This converter does not treat the first inner array as the header, so if your first inner array holds the column names, switch the header row off and the names appear as the first data row. This is the one-line HTML (indentation None) and the Markdown for [["name","score"],["Ada",91],["Grace",88.5]] with the header row off:
HTML table output with the header row off and no indentation
<table><tbody><tr><td>name</td><td>score</td></tr><tr><td>Ada</td><td>91</td></tr><tr><td>Grace</td><td>88.5</td></tr></tbody></table>
Markdown table output with the header row off
| | | | --- | --- | | name | score | | Ada | 91 | | Grace | 88.5 |
Use the HTML table for a web page, a CMS block, a documentation site that renders HTML, or an email. The table has no styling of its own, so give it a class and style it in your CSS, or use the class of a framework you already load. Some email clients ignore or rewrite style blocks, so for email you may need inline styles, which this tool does not add. Use the Markdown table for a README, a wiki, an issue or a pull request description. GitHub Flavored Markdown tables need a header line, a delimiter line under it and one line per row, which is why this page writes an empty header when the header row is off and uses a br tag for line breaks. A Markdown table cannot merge cells, and a long text value makes the raw text hard to read, so keep the columns few.
A small starting stylesheet for the HTML output, if you give the table the class data:
table.data { border-collapse: collapse; }
table.data th, table.data td { border: 1px solid #ccc; padding: 4px 8px; text-align: left; }
table.data thead th { background: #f3f4f6; }
That happens when the JSON is a list of plain values such as ["red","green"] rather than a list of objects. A table needs named columns, so the values are written under a column called value. Wrap each value in an object first if you want your own column name.
An array that holds objects cannot be joined into a readable cell, so the Join option keeps it as compact JSON text and shows a notice. Choose Indexed columns to flatten each item into its own columns, such as lines.0.sku and lines.0.qty. If every row has a different number of items, the table becomes wide, so check the column count in the status line.
A JSON number with more than 15 significant digits, such as 12345678901234567890, is written exactly as it appears in your JSON and a warning says so. Pasting it into a spreadsheet may still round it, which is why IDs of that length are best stored as strings.
JSON has no date type, so a date is a string and is written as it is. The converter does not reformat it.
The conversion runs in a background worker, but a browser still has to lay out every row of an HTML table you paste into a page. For thousands of rows, paginate the table or load the rows from your own code rather than embedding all of them in one page.
Files up to 25 MB are accepted. A file above about 1.5 MB is converted straight from the file and is not placed in the text box. The conversion runs in a background worker with a time limit that grows with the file size, a progress count, and a Cancel button. The rendered preview shows the first 100 rows and up to 60 columns, and the text box shows the first 200,000 characters of the markup, while Download always writes the full result. Copy stops above about 5 million characters, so use Download for very large output. The output is limited to 16,384 columns.
Paste your JSON, choose a .json file or load the sample. The HTML table and a rendered preview appear as soon as the JSON is valid. Copy the markup or download it as an .html file, or switch to the Markdown tab for a Markdown table.
A nested object is flattened with dot notation, so address.city becomes a column named address.city. An array can be joined into one cell, expanded into indexed columns such as tags.0 and tags.1, or kept as a JSON string. Rows with different keys get empty cells for the keys they lack. These are the same rules as the JSON to CSV converter.
The converter escapes the characters &, <, >, double quotes and single quotes in every header and data cell, so a value such as a script tag is written as visible text and does not run. The only tags in the output are table, thead, tbody, tr, th, td and br, plus the class and id you type, which are escaped as well.
Open the Markdown table tab. The table has a header line, a delimiter line and one line per row. A pipe in a value is written as \|, a backslash is doubled, a < is written as <, and a line break becomes a br tag, because a table cell cannot hold a real line break. With Header row off the header cells are written empty, because a Markdown table needs a header line.
No. The JSON is converted by a script running in your browser tab, and the converter does not send it anywhere. The page uses Google Analytics for anonymous usage counts, which never include your JSON, keys or file names.
Yes. Type a class (several classes separated by spaces, such as table table-striped) and an id in the HTML options, and they go on the table element. Both are escaped, and spaces in the id are replaced by hyphens. Switch off the thead and tbody option if your system wants the rows directly inside the table.
Yes, files up to 25 MB. They are converted in a background worker, so the page stays responsive while a progress count runs, and a Cancel button appears if it takes longer than a second. The rendered preview shows the first 100 rows, while Copy and Download use every row.
Built and maintained by Deepak Kumar.