JSON to HTML Table

Convert JSON arrays to styled HTML table markup. Optional inline CSS included.

What is JSON to HTML Table Conversion?

Converting a JSON array to an HTML table turns structured data into a visual table that can be embedded directly in web pages, emails, or CMS content. Each JSON object in the array becomes a table row, and the object keys become column headers — no template code required.

This is useful for building data dashboards, generating reports that include tabular data, inserting dynamic content into email templates, creating documentation pages from API responses, or producing quick visual summaries of database exports.

JSON to HTML Table Example

json
[
  { "name": "Alice", "score": 95, "grade": "A" },
  { "name": "Bob",   "score": 82, "grade": "B" }
]

Generates:

html
<style>
table { border-collapse: collapse; width: 100%; font-family: sans-serif; }
th, td { border: 1px solid #ddd; padding: 8px 12px; text-align: left; }
th { background: #f5f5f5; font-weight: 600; }
tr:nth-child(even) { background: #fafafa; }
</style>
<table>
  <thead>
    <tr><th>name</th><th>score</th><th>grade</th></tr>
  </thead>
  <tbody>
    <tr><td>Alice</td><td>95</td><td>A</td></tr>
    <tr><td>Bob</td><td>82</td><td>B</td></tr>
  </tbody>
</table>

XSS Safety

All cell values are HTML-escaped: &, <, >, and " are replaced with their HTML entity equivalents. This prevents XSS when rendering untrusted data.

Frequently Asked Questions

Yes — inline the CSS as style attributes on each element, as email clients strip <style> blocks. Use the table structure and add style= to each th and td.

Paste the HTML into your component template (dangerouslySetInnerHTML in React, or [innerHTML] in Angular). Ensure the source JSON is trusted.

Uncheck 'Include CSS styling' in the toolbar to get a bare <table> element you can style yourself.

Nested objects are JSON.stringify'd into the cell. Flatten your JSON first using the JSON Flatten tool for cleaner output.

Related Tools