JSON to HTML Table
Paste a JSON array to see it as a table and get escaped HTML table code you can paste anywhere.
Render a JSON table in JavaScript
If the data changes at runtime, build the table in the browser instead of pasting static HTML. Use textContent, not innerHTML, so values cannot inject markup.
function renderTable(records, container) {
const columns = [...new Set(records.flatMap(Object.keys))];
const table = document.createElement("table");
const head = table.createTHead().insertRow();
columns.forEach(c => (head.insertCell().textContent = c));
const body = table.createTBody();
records.forEach(r => {
const row = body.insertRow();
columns.forEach(c => (row.insertCell().textContent = r[c] ?? ""));
});
container.replaceChildren(table);
}For a spreadsheet, use JSON to CSV or JSON to Excel. Deeply nested data is easier to read in the JSON viewer.
Need to read or debug JSON from this result? Paste it into the JSON beautifier to format, validate and explore it as a tree.
Frequently Asked Questions
What JSON shape works best?
An array of objects, where each object is one row. A single object becomes a one-row table. If your API wraps the records, for example in data or results, paste just that array.
What happens to nested objects and arrays?
With Flatten nested objects on, address.city becomes its own column. Arrays are joined into one cell with semicolons. Turn flattening off to keep nested objects as JSON text in a single cell.
Is the generated HTML safe to paste into a page?
Values are HTML-escaped, so text such as <script> appears as visible text rather than running as code. The markup has no inline styles or classes, so it picks up your site's own table CSS.
Can I view JSON as a table without the HTML?
Yes. The rendered preview is a readable table of the first 50 rows. To work with the data in a spreadsheet instead, use JSON to CSV or JSON to Excel.