JSON to CSV
Convert a JSON array into CSV for Excel, Google Sheets or a database import. Nested objects flatten into dotted columns, and records with different shapes are merged into a single column set.
- Files never leave your device
- Free, no signup
- No watermarks
- Works offline once loaded
How to json to csv
- 1
Paste your JSON
An array of objects works best — the tool will tell you if it needs a different shape.
- 2
Choose your options
Pick a delimiter, and whether to flatten nested objects into dotted columns.
- 3
Download the CSV
Save it and open it directly in Excel or Google Sheets.
Why JSON and CSV are fundamentally different shapes of data
JSON is built to represent arbitrarily nested, tree-shaped data — objects inside objects, arrays inside objects, values of genuinely different types sitting side by side — while CSV can only represent one flat, uniform table: rows and columns, every row with the same set of columns, every cell a single plain value. Converting from the first shape to the second necessarily means making decisions about how to flatten something that does not naturally fit into rows and columns, which is where most of the actual complexity in this kind of conversion lives — not in reading the JSON syntax itself, which is straightforward, but in deciding what a spreadsheet row should even mean for data that was never tabular to begin with.
How nested objects become dotted column names
A nested object like `{"user": {"name": "Ada", "id": 42}}` has no single obvious column to become in a flat table, so it flattens into two separate columns — `user.name` and `user.id` — with the dot notation preserving exactly where each value came from in the original structure. This is a widely recognised convention specifically because it is reversible: a column named `user.name` unambiguously describes a path back into a nested structure, which matters if the CSV ever needs to be converted back to JSON or imported into a system that understands dotted paths as nested fields.
Nested arrays are handled differently, and deliberately so: rather than exploding an array into additional rows — which would change how many rows the table has depending on how many nested items happen to be inside one record, a genuinely surprising and often unwanted side effect — an array value is serialised as JSON text inside a single cell. The row count stays predictable and matches the input record count exactly, which is almost always what someone converting to a spreadsheet actually wants, at the cost of that one cell needing further parsing if its contents are needed individually.
Handling a mix of records that do not all have the same fields
Real API responses and hand-assembled JSON frequently contain records where not every object has identical keys — an optional field present on some records and absent on others, or a schema that evolved over time so older and newer records differ slightly. CSV cannot represent that variation directly, since every row needs to align to the same fixed set of columns; a program reading a CSV file has no way to know a row is "missing" a column unless every row explicitly has a cell for it. The resolution is computing the union of every key seen across every record, in the order each key was first encountered, and filling an empty cell for any record that is missing a given field — so the shape stays consistent across the file without silently dropping any record's columns or misaligning values into the wrong column.
Frequently asked questions
What JSON shape does it expect?
An array of objects — the shape almost every API returns. A single object is treated as a one-row table. Arrays of primitives produce a single-column file.
How are nested objects handled?
They flatten into dotted column names, so `{"user":{"name":"Ada"}}` becomes a column called `user.name`. Nested arrays are written as JSON text in one cell rather than exploded into extra rows, because changing the row count is almost never what a spreadsheet export wants.
What if my records have different fields?
The column set is the union of every key found, in the order first seen. Records missing a field get an empty cell rather than being dropped or misaligned.
Why does Excel mangle my CSV?
Usually the delimiter: Excel in many European locales expects semicolons, not commas. Switch the delimiter option. Excel also reformats long numeric IDs as scientific notation on open — importing via Data → From Text avoids that.
Are quotes and commas inside values escaped?
Yes, per RFC 4180. Fields containing the delimiter, a quote or a line break are wrapped in quotes, and internal quotes are doubled — so the file round-trips correctly through any compliant reader.