You pulled some data from an API, or exported it from a tool, and it came back as JSON — nested, bracketed, and completely unreadable in a spreadsheet. You want it in Excel or Google Sheets as rows and columns so you can sort, filter, and hand it to someone who doesn't think in curly braces. That's a JSON → CSV conversion, and the only real question is how your nested data flattens into a flat table.
The core problem: JSON is a tree, CSV is a grid
JSON nests. An object can hold objects, which hold arrays, which hold more objects. CSV doesn't nest — it's a flat grid of rows and columns. So every converter has to make decisions about how to squash a tree into a grid, and those decisions are where the quality difference lives.
The standard, sane approach is dotted-key flattening. A nested object like:
{"user": {"profile": {"name": "Ada"}}}
becomes a single column header user.profile.name with the value Ada. Deeply nested data still fits one row; you just get longer column names. Our converter does exactly this — it recursively flattens nested objects into dotted headers and maps them straight into the CSV.
What flattens cleanly and what doesn't
- An array of flat objects — the ideal case.
[{"id":1,"name":"A"},{"id":2,"name":"B"}]becomes a clean two-column, two-row table. This is what most API list endpoints return, and it converts perfectly. - Nested objects — flatten to dotted columns, as above. Fine.
- Arrays of primitives (a list of tags, say) — get serialized into a single cell as text, since there's no clean way to spread an arbitrary-length list across fixed columns.
- Wildly irregular records — if every object has different keys, you'll get a sparse table with lots of empty cells. That's honest behavior, not a bug; the data really is that irregular.
The fastest route: drop it on Formatly
- Open formatly.app/convert/json-to-csv.
- Drag your
.jsonfile into the upload box, or click to pick it. - Hit Convert, download the CSV, and open it in your spreadsheet app.
No signup, nothing to install, files deleted after an hour. It handles the flattening automatically, so you don't write a line of code or wrestle with a one-off Python script just to look at your data in a table.
The code route (if you'd rather)
If you live in a terminal, jq can do it: jq -r '(.[0] | keys_unsorted), (.[] | [.[]]) | @csv' works for a flat array of objects, but it falls apart the moment your data nests, and you'll be reaching for a real script. pandas.read_json().to_csv() in Python is the heavier-duty answer. Both are fine if you already have the tooling open; neither is faster than dropping the file in a browser for a one-time conversion.
Going the other way
Need to turn a spreadsheet back into JSON — to seed a config file, feed an API, or build a test fixture? That's CSV → JSON, and our converter casts values to real types (numbers, booleans, nulls) instead of dumping everything as strings. And if your data needs to land in a config format or a legacy system instead, see JSON → YAML and JSON → XML.
Related
- JSON → CSV converter →
- CSV → JSON → for the reverse direction
- JSON → YAML → for config files
- Excel → CSV → pull a spreadsheet into plain rows first
- All supported formats →