What is this calculator?
Converts a JSON array of objects into CSV. Nested objects are flattened into dotted column names, and the header row is the union of every key found across all rows, so no field is silently dropped because it was missing from the first record.
Use it when:
- You have an API response and need it in a spreadsheet.
- You are preparing JSON data for a system that only accepts CSV.
- Your records have inconsistent keys and you need a header that covers all of them.
Intended for: Developers, analysts, and anyone moving structured data into a spreadsheet.
How is this calculated?
- The input is parsed as JSON and must be an array; each element becomes one CSV row.
- Every object is flattened depth-first, so a nested value at `user.address.city` becomes the column `user.address.city`.
- The header row is the sorted union of every key across every row — a key present in only one record still gets a column, and rows without it are left blank.
- Each cell is serialised, and any value containing a comma, quote, or newline is wrapped in double quotes with internal quotes doubled, per the usual CSV escaping convention.
Example
Converting `[{ "name": "Ada", "age": 36 }, { "name": "Alan", "city": "London" }]`.
- The union of keys across both records is age, city, name.
- Row 1 has no city; row 2 has no age. Both become empty cells.
Result: Header `age,city,name`, then `36,,Ada` and `,London,Alan` — 2 rows, 3 columns.
Frequently asked questions
What happens to nested objects and arrays?
Nested objects are flattened into dotted column names. Arrays are serialised into the cell rather than expanded into columns, because there is no unambiguous way to spread a variable-length array across a fixed header.
Why are columns sorted alphabetically?
Because JSON object key order is not guaranteed to be meaningful across records. Sorting makes the output deterministic — the same input always produces the same column order.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser; nothing is sent to a server or stored.
Assumptions
What this calculator takes as given:
- The transformation is performed in your browser; the text you paste is not uploaded or stored.
- Input is treated as UTF-8 text.
- The top level of the input is a JSON array whose elements are objects.
Limitations
What this calculator cannot know or does not model:
- A JSON object at the top level (rather than an array) is not converted — wrap it in an array first.
- Arrays inside a record are serialised into a single cell rather than expanded into columns.
- Very large inputs are limited by browser memory, since the whole document is parsed at once.