Skip to content
🛠️ToolsShed

JSON to Table

Visualize JSON arrays as HTML or Markdown tables.

About this tool

JSON is a ubiquitous data format used across APIs, databases, and web applications, but displaying raw JSON arrays as structured tables is crucial for data analysis and documentation. The JSON to Table tool converts JSON arrays into readable HTML or Markdown tables, making it easy to visualize tabular data without manual formatting. This is essential for developers, data analysts, and technical writers who need to present structured data in a format that's accessible to both machines and humans.

To use this tool, paste a JSON array of objects into the input field and choose your desired output format—either HTML table markup for web pages or Markdown table syntax for documentation. The tool automatically extracts all unique keys from your JSON objects and uses them as column headers, then serializes the data into properly formatted table rows. This works perfectly for API responses, database exports, configuration comparisons, and any scenario where you need to transform nested JSON into a readable tabular representation.

Frequently Asked Questions

Code Implementation

def json_to_markdown_table(data: list[dict]) -> str:
    if not data:
        return ""
    headers = list(data[0].keys())
    rows = []
    rows.append("| " + " | ".join(headers) + " |")
    rows.append("| " + " | ".join(["---"] * len(headers)) + " |")
    for row in data:
        cells = [str(row.get(h, "")) for h in headers]
        rows.append("| " + " | ".join(cells) + " |")
    return "\n".join(rows)

data = [
    {"name": "Alice", "age": 30, "city": "Seoul"},
    {"name": "Bob",   "age": 25, "city": "Tokyo"},
]
print(json_to_markdown_table(data))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.