How to convert JSON to CSV
- Pick the JSON file. JSON Lines files (.jsonl or .ndjson) with one record per line also work.
- Choose the separator: semicolon for Excel set up with a decimal comma, comma for most other cases.
- Tick Add a UTF-8 BOM under More settings if the file is going to Excel on Windows, then convert.
From records to rows
An array of records is the classic input, but other shapes are accepted too. A response that wraps its records, such as {"orders": [ … ]}, is unwrapped automatically when that is its only list of objects; a single object becomes one row; and nested lists of values are copied row by row.
Column order follows the order in which each field is first met, and records that lack a field simply leave that cell blank, so uneven data still lines up.
Nested fields and lists
Spreadsheets cannot nest, so a customer object inside an order is spread over columns like customer.name and customer.email. Lists inside a record can be kept as JSON text in one cell, split into numbered columns such as items.0 and items.1, or joined into one readable cell like "A4; A3; Letter".
Joining only applies to lists of plain values. A list of objects, for example order lines, is kept as JSON text so no information is dropped.
Getting it into Excel cleanly
Excel for Windows assumes an old code page unless the CSV starts with a byte order mark, which is why accented names often look broken there. The BOM option adds that marker. Separator choice matters as well: Excel in many European locales only separates columns at semicolons when a file is opened by double-click.
Long order numbers and IDs are written with all their digits in current browsers, and values that contain the separator, quotes or line breaks are quoted the standard way.
Questions
Why does Excel still show 1.23457E+19 for an ID?
The CSV holds the full number, but Excel converts long digit strings on opening. Import the file through Data, From Text/CSV and set that column to Text.
The file is rejected with a line and column. Why?
The JSON is malformed at that point, often a trailing comma, a missing quote or a comment. Fix that spot and try again.