JSON Array to CSV
Turn an array of objects or a 2-D array into CSV: the header is the union of keys and cells with delimiters, quotes or newlines are escaped per RFC 4180. The delimiter is configurable.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
Accepts an array of objects or a two-dimensional array. Cells containing the delimiter, quotes or newlines are wrapped in double quotes with inner quotes doubled.
CSV output
An array of objects gets a header row (the union of keys); a two-dimensional array has no header and is written row by row.
Paste a JSON array to see the CSV
What this tool does
- Turn an API array of objects into CSV for Excel or a database import
- Serialise a two-dimensional array into comma-separated text for a legacy system
Example
Input
[{"name":"Ada","city":"Paris"},{"name":"Bob","city":"Berlin"}]Output
name,city Ada,Paris Bob,Berlin
The header is the union of keys; cells containing the delimiter are quoted.
Frequently asked questions
What quoting rules are used?
RFC 4180: a cell containing the delimiter, a double quote or a newline is wrapped in double quotes with inner quotes doubled (" becomes "").
Where does the header come from?
From the union of all object keys in first-seen order. Missing values become empty cells, which are indistinguishable from an empty string. A two-dimensional array gets no header.
How do I avoid mojibake in Excel?
CSV carries no encoding declaration and Excel on Chinese systems assumes GBK. Save the pasted text as UTF-8 with BOM to display it correctly.
Does it produce a file?
No, it only generates text to copy. Use a download-capable tool if you need a .csv file directly.
Keywords:json array to csvjson to csv