How nested JSON becomes columns
CSV is flat: rows and columns, nothing inside anything. JSON usually isn't. The converter collects every property path it finds across all records and makes each one a column, in the order it first appears:
[
{ "id": 1, "name": "Ada", "address": { "city": "London", "zip": "02134" } },
{ "id": 2, "name": "Grace", "address": { "city": "New York" }, "active": false }
]
id,name,address.city,address.zip,active
1,Ada,London,02134,
2,Grace,New York,,falseRecords don't need the same properties. A missing value leaves the cell empty, so the second row has no ZIP and the first has no active value.
Arrays inside records
A property like "tags": ["math", "poetry"] has no natural place in one cell. Two options:
- Keep as JSON writes
["math","poetry"]into the cell, so nothing is lost and you can convert it back. - Join with “; ” writes
math; poetry, which reads better in a spreadsheet. Arrays of objects always stay JSON.
If you need one row per array item instead, for example one row per order line, reshape the JSON first so each item is its own record.
Opening the CSV in Excel without surprises
| Problem | Cause | Fix |
|---|---|---|
| Accents and emoji show as é or ? | Excel doesn't assume UTF-8 | Keep “Add UTF-8 BOM” on when downloading |
| Everything lands in column A | Your Excel expects semicolons (common in Europe) | Choose the semicolon delimiter |
| 02134 becomes 2134 | Excel converts numeric-looking text when opening a CSV | Import via Data → From Text/CSV and set the column to Text |
| Long IDs turn into 1.23E+19 | Excel keeps only 15 significant digits | Import the column as Text, as above |
Google Sheets reads UTF-8 correctly without a BOM, but it also strips leading zeros unless the column is formatted as plain text.
CSV formula injection
Spreadsheet apps treat any cell starting with =, +, - or @ as a formula. If the JSON contains text that users typed, such as names, comments or support tickets, a value like =HYPERLINK("https://evil.example","Click") becomes a live link when someone opens the file. OWASP lists this as CSV injection. The “Neutralise spreadsheet formulas” option prefixes those values with an apostrophe, which spreadsheets display as plain text. Leave it off for data that legitimately starts with a minus sign, such as negative numbers stored as strings.
Converting JSON to CSV in code
# Python with pandas (flattens nested objects)
import pandas as pd, json
df = pd.json_normalize(json.load(open("data.json")))
df.to_csv("data.csv", index=False, encoding="utf-8-sig") # utf-8-sig adds the BOM
# jq (flat objects)
jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json
# PowerShell
Get-Content data.json | ConvertFrom-Json | Export-Csv data.csv -NoTypeInformationThe jq one-liner takes its columns from the first object, so properties that only appear in later records are dropped. The converter above collects columns from every record.
Need the reverse? The CSV to JSON Converter turns a spreadsheet export back into JSON, keeping types and leading zeros.
Frequently asked questions
How do I convert JSON to CSV?
Paste a JSON array of objects, a single object or JSON Lines, or open a .json file. Each object becomes a row and each property becomes a column. Objects that are missing a property get an empty cell. Copy the CSV or download it.
How are nested JSON objects converted?
With flattening on, nested properties become columns named with dot paths: { "address": { "city": "London" } } becomes an address.city column. Turn flattening off to keep each nested object as a JSON string in a single cell.
Why do accented characters look wrong when I open the CSV in Excel?
Excel on Windows assumes CSV files use the system's legacy encoding unless the file starts with a UTF-8 byte-order mark. Keep the BOM option on when downloading and characters such as é, ü and emoji display correctly.
What is CSV formula injection?
Spreadsheet apps run any cell that starts with =, +, - or @ as a formula. If your JSON contains user-submitted text, a value like =HYPERLINK(...) can execute when someone opens the CSV. The neutralise option adds an apostrophe before such values so they display as text.
Can I convert a JSON file with a wrapper object, like { "data": [...] }?
Yes. When the JSON is an object that contains an array of records, the converter uses that array and tells you which property it read. A plain object with no such array becomes a single row.
Is my JSON sent to a server?
No. The conversion runs entirely in your browser, so API responses, exports and customer data stay on your device.
Related Tools
- Cron Expression Generator — Build and read cron expressions in plain English, see the next 10 run times, and convert between crontab, Spring, Quartz and AWS EventBridge formats.
- CSS Minifier & Beautifier — Minify CSS with only rendering-safe changes, keeping licence comments, strings and calc() intact, or beautify minified CSS into readable, indented code.
- URL Encoder & Decoder — Percent-encode or decode URLs and query strings with component, full-URL, RFC 3986 or form (+) rules.
- Base64 Decode & Encode — Decode Base64 to text, images or files and encode text or files to Base64 and data URIs.
- CSV to JSON Converter — Convert CSV to JSON with delimiter detection, correct handling of quoted fields and leading zeros, and array, keyed-object or JSON Lines output.
- Meta Tag Checker — Check a page's title, meta description, robots directives, canonical, viewport and hreflang tags, with a Google result preview and a fix for each issue.