About JSON to CSV
Drop in a JSON array of objects and get a CSV with nested keys auto-flattened in dot notation. Pick delimiter (comma, tab, semicolon, custom), quote style (always, when-needed), and line ending (LF, CRLF). A live preview shows the column types inferred from the data so the receiving spreadsheet does not surprise you.
Why convert JSON to CSV?
Spreadsheets, BI tools, and most data scientists still want CSV. JSON is great for APIs and configs; CSV is what you hand to Excel, Google Sheets, Tableau, or pandas.read_csv. The conversion is straightforward in flat cases — and surprisingly nasty when objects nest, when arrays mix types, or when keys differ across rows.
This converter does the boring part well: handles missing keys, flattens nested paths consistently, quotes per RFC 4180, and emits exactly the file your spreadsheet expects.
How flattening works
Input:
[{
"id": 1,
"user": { "name": "Ana", "email": "ana@example.com" },
"tags": ["admin", "billing"]
}]
Output:
id,user.name,user.email,tags
1,Ana,ana@example.com,"admin, billing"
Dot notation for nested objects, joined string for primitive arrays, indexed paths for object arrays. The naming is predictable so a downstream consumer can re-shape it back if needed.
Common workflows
Hand off API data to a non-developer. Fetch the JSON, paste here, download the CSV, share. They open it in Sheets, do their analysis, you skip the meeting.
Diff structured exports. Run two exports through this, then drop both CSVs into the Diff Checker. Useful for catching silent schema drift between environments.
Bulk import to your warehouse. Most warehouses’ COPY commands prefer flat CSV. Transform here, run the load, skip the row-by-row API path.
Convert back round-trip. Use CSV to JSON to verify your flattening preserves all the data — every dot-key reconstructs back into the same nested shape.
How to convert JSON to CSV in code
When you need the conversion inside a pipeline instead of the browser, here are the canonical one-liners. Test the shape here first, then reach for these:
Python (flat, stdlib):
import json, csv
data = json.load(open("in.json"))
with open("out.csv", "w", newline="") as f:
w = csv.DictWriter(f, fieldnames=data[0].keys())
w.writeheader(); w.writerows(data)
For nested JSON, use pandas.json_normalize(data).to_csv("out.csv", index=False) — it flattens like this tool does.
jq (command line):
jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]])[] | @csv' in.json > out.csv
PowerShell:
Get-Content in.json | ConvertFrom-Json | Export-Csv out.csv -NoTypeInformation
Node.js:
import { writeFileSync } from "fs";
const data = JSON.parse(readFileSync("in.json"));
const cols = Object.keys(data[0]);
const csv = [cols.join(","), ...data.map(r => cols.map(c => JSON.stringify(r[c] ?? "")).join(","))].join("\n");
writeFileSync("out.csv", csv);
C# (.NET) — use System.Text.Json to deserialize, then CsvHelper’s WriteRecords, or build lines manually for a console app.
Each of these breaks on nested objects and ragged rows unless you add flattening logic. That is exactly the part this tool automates — paste, download, done.
Settings that matter
- Delimiter — comma is universal; tab gives you
.tsv, no quoting issues with commas. - Line ending — LF for Unix tooling, CRLF for Windows Excel.
- Quote — when-needed (RFC 4180) is the default; quote-all if downstream is paranoid.
- Date format — ISO 8601 always parses; locale formats save formatting steps in spreadsheets.
The right combination depends on the receiver. Default RFC 4180 + UTF-8 + LF works in 90% of cases.
Frequently asked questions
How are nested objects flattened?
{"user":{"name":"Ana"}} becomes a user.name column. Arrays of primitives become a single column joined by your chosen separator; arrays of objects become indexed paths (items.0.sku, items.1.sku).Can I customize the delimiter?
What about quoting?
How does it handle missing keys?
null, your choice). Type inference still works on the present values.Is it the right tool for very large JSON?
jq -r with @csv, or a Python script with ijson.Can it handle a top-level object?
How do I convert JSON to CSV in Excel?
.csv, and open it in Excel (use semicolon as the delimiter for European locales so columns split correctly). Excel's own Data → Get Data → From JSON works only for flat arrays and mangles nested objects — this tool flattens them to dot-notation columns first.What is the best tool for converting JSON to CSV?
jq -r. The differences show up with nested objects, arrays of objects, and rows that do not share keys. This converter handles all three (dot-notation flattening, indexed array paths, key union across rows), runs locally so your data stays private, and needs no install — the reasons to prefer it over a script or an upload-based site.Related tools
Last updated: 2026-07-04