JSON to CSV

Convert JSON arrays to CSV format with automatic column header detection

Shortcuts: Ctrl+Enter run · Ctrl+L clear · Ctrl+D download

About JSON to CSV

This tool converts JSON arrays into CSV format, making it easy to open your data in Excel, Google Sheets, or any spreadsheet application. It automatically detects column headers from the JSON keys, handles nested values gracefully, and produces a clean CSV you can download immediately. No spreadsheet import wizard required.

  • ✓Auto-detects column headers from top-level JSON keys
  • ✓Handles arrays of objects of any size
  • ✓Properly escapes values that contain commas, quotes, or newlines
  • ✓One-click download as a .csv file ready for Excel or Google Sheets

Getting Clean Spreadsheets from JSON Data

JSON and CSV represent data very differently — JSON is a tree of nested structures, while CSV is a flat grid of rows and columns. Converting between them is straightforward for simple data and genuinely tricky for nested data, so it helps to understand what the converter is actually doing under the hood.

The shape that converts cleanly

// Ideal input — a flat array of objects with consistent keys
[
  { "name": "Alice", "age": 30, "city": "Berlin" },
  { "name": "Bob",   "age": 25, "city": "Madrid" }
]

// → CSV
name,age,city
Alice,30,Berlin
Bob,25,Madrid

Each object becomes a row, and the union of all keys becomes the column headers — this is exactly the shape produced by most "list" or "search results" API endpoints, which is why this conversion is so commonly needed.

What happens with nested data

  • ·CSV has no native concept of nesting — a cell holds a single scalar value, not a sub-table
  • ·When a JSON value is an object or array, it gets serialized as a JSON string inside that cell (e.g., a cell containing `{"city":"Berlin","zip":"10115"}`) so no data is lost, but it is no longer "spreadsheet friendly"
  • ·If you want each nested field in its own column (e.g., `address.city`, `address.zip`), flatten the data first — the JSON Flattener tool turns nested keys into dot-notation paths that map naturally onto separate CSV columns

Tip: Workflow for nested API data: JSON Flattener → JSON to CSV. Flattening first turns `{"address":{"city":"Berlin"}}` into `{"address.city":"Berlin"}`, which then produces a clean dedicated column instead of a stringified blob.

Escaping rules that keep spreadsheets happy

  • ·Values containing commas, double quotes, or newlines must be wrapped in double quotes, with internal double quotes doubled (`"` becomes `""`) — this is what RFC 4180 specifies and what Excel and Google Sheets expect
  • ·Without correct escaping, a value like `Smith, John` would be misread as two separate columns — proper quoting prevents this silently-wrong-import problem
  • ·This tool applies that escaping automatically, which is the main advantage over a naive "join with commas" approach

Common pitfalls when opening the result

  • ·Leading zeros and large numbers — values like `"00123"` or long ID numbers can be auto-converted to numbers (and lose their leading zeros, or display in scientific notation) when opened in Excel; format the column as Text on import if this matters
  • ·Encoding — if special characters look garbled after opening in Excel, re-import the file specifying UTF-8 encoding explicitly
  • ·Inconsistent keys — if some objects in the array are missing keys that others have, those cells will simply be empty in the output rather than causing an error

Frequently Asked Questions

Ad