Input shape

The cleanest conversion is an array of flat objects: [{"id":1,"name":"A"},{"id":2,"name":"B"}]. Each object becomes a row and the union of keys becomes the header. If objects have different keys, missing values are left empty.

A single object is treated as one row. A nested object such as {"user":{"id":1}} becomes a column named user.id. Arrays inside objects are serialized as JSON strings in the cell, because CSV has no nested structure.

json
[
  {"id": 1, "name": "Ada", "tags": ["math", "code"]},
  {"id": 2, "name": "Grace", "tags": []}
]

→ id,name,tags
  1,Ada,"[""math"",""code""]"
  2,Grace,[]

Quoting rules

Fields containing a comma, a double quote or a newline are wrapped in double quotes, and internal quotes are doubled. This matches RFC 4180 and is what Excel expects. If your locale uses semicolons as separators, change the delimiter after downloading — Excel's behavior depends on the regional setting.

CSV does not protect against spreadsheet formula injection. Excel and other apps may evaluate a cell that begins with =, +, - or @; treat a CSV exported from untrusted JSON as data, open it with the import wizard, and do not enable macros.

Excel may interpret a leading zero or a long ID as a number and strip digits. Open the CSV with the import wizard and set those columns to text if precision matters.