JSON to CSV
Turn a JSON array into CSV text, using the keys of the first object as the header row and quoting fields that contain commas, quotes, or line breaks. Useful for pasting API results into a spreadsheet. Nested objects appear as [object Object], and arrays are joined into a single string.
How to use
- Paste a JSON array of flat objects.
- The keys of the first object become the header row.
- Copy the CSV into a spreadsheet, or save it as a .csv file.
FAQ
Why are some columns missing?
The header comes from the first object only, so fields that appear later are dropped. Make the objects share the same keys first.
How are nested values handled?
They are not expanded. An object becomes [object Object], and an array is joined with commas. Flatten the data or convert those values to strings first.
Chinese looks garbled in Excel. What should I do?
The output is UTF-8 text. Choose UTF-8 when importing it into Excel.
Further reading