Paste a JSON array into the Quick paste box. The tool flattens it into a table and writes a table element with thead, th and td. It handles tabular data only and does not keep nested structure.
Runs entirely in your browser. Your data is never uploaded. Tiếng Việt
You need JSON to HTML when you want API data on a static page, in an email or in an article without writing a loop. JSON can nest several levels deep, while an HTML table has only rows and columns. With Flatten nested objects (a.b.c) on, nested objects become columns named a.b.c and arrays become a.0, a.1, each as its own cell. You end up with a wider table than the source JSON suggests.
Quick paste box and press Load into table ↵, or use Import file with a .json file. This page already has flattening on.⚙ Options. Enter a class for the table if your page uses a CSS framework, and choose whether to use thead.Copy result and paste into your page source, or Download file for an .html file.The header row keeps the a.b.c key paths from the JSON, and the array cells order.items.0, order.items.1, order.items.2 sit side by side. Order A2 has one item, so its last two cells are empty. The table carries class="table".
[
{
"id": "A1",
"customer": {
"name": "Anna Reed",
"city": "London"
},
"order": {
"total": 450,
"items": [
"book",
"pen"
]
}
},
{
"id": "A2",
"customer": {
"name": "Ben Cole",
"city": "Leeds"
},
"order": {
"total": 1250,
"items": [
"backpack"
]
}
},
{
"id": "A3",
"customer": {
"name": "Cara Lin",
"city": "Bristol"
},
"order": {
"total": 299.5,
"items": [
"notebook",
"pen",
"ruler"
]
}
}
]<table class="table">
<thead><tr><th>id</th><th>customer.name</th><th>customer.city</th><th>order.total</th><th>order.items.0</th><th>order.items.1</th><th>order.items.2</th></tr></thead>
<tbody>
<tr><td>A1</td><td>Anna Reed</td><td>London</td><td>450</td><td>book</td><td>pen</td><td></td></tr>
<tr><td>A2</td><td>Ben Cole</td><td>Leeds</td><td>1250</td><td>backpack</td><td></td><td></td></tr>
<tr><td>A3</td><td>Cara Lin</td><td>Bristol</td><td>299.5</td><td>notebook</td><td>pen</td><td>ruler</td></tr>
</tbody>
</table>table table-striped. Only letters, digits, hyphens and underscores are kept.No. It is flattened into one table with a.b.c columns. There are no sub-tables inside cells.
Yes. Type a class such as table table-striped into <table> class.
Use the Rich text tab instead of HTML: it gives a formatted table to paste directly. The HTML tab is for source code.
Yes. Paste a table copied from a browser, paste HTML that starts with <table, or use Import file with an .html file. The first table is read, text only, and colours are ignored. See the HTML to JSON page.
No. Everything runs in your browser.