How to convert JSON to CSV

JSON is nested; CSV is flat. Converting between them means deciding how to represent objects and arrays, and being careful with number precision.

Find the array of records

A JSON file may be an array of objects, or an object that wraps the array under a key. If the root is an object, the longest array underneath it is usually the intended record list.

Flatten nested objects

Nested objects are expanded into dot-notation columns, so address.city becomes a column named address.city. This keeps every value while producing a flat table.

Decide how to show arrays

Arrays do not map to a single cell cleanly. Keeping them as compact JSON text, like ["vip","newsletter"], preserves the data without inventing columns.

Protect number precision

Very large integers lose precision if they pass through a JavaScript number. A good converter reads numbers as text so values like 12345678901234567890 stay exact.

Do it in your browser

Frequently asked questions

What if the JSON root is a single object?
It becomes a single row, or the longest nested array is used, with a note explaining the choice.
Will the CSV open in Excel?
Yes. It is written with CRLF line endings and a UTF-8 BOM so non-Latin text renders correctly.
Is my JSON uploaded?
No. The conversion is fully client-side.

Keep reading