JSON ⇄ CSV Converter
This converter turns a JSON array of objects into a spreadsheet-ready CSV — and back again — without uploading your data anywhere. Most online converters POST your file to a server; this one runs entirely in your browser tab, so API exports, customer lists, and database dumps never leave your machine. Nested objects are flattened into dot-notation columns (user.name), arrays become indexed columns (tags[0]), and the output follows RFC 4180 quoting so Excel, Google Sheets, and pandas all read it correctly.
Paste JSON or CSV above — conversion happens instantly, entirely in your browser.
How to use the json ⇄ csv converter
- Pick a direction: JSON → CSV or CSV → JSON.
- Paste your data, or start from the placeholder example to see the flattening rules.
- Choose a delimiter — use semicolon if your Excel is set to a European locale.
- For Excel, keep the UTF-8 BOM enabled so accented characters and currency symbols display correctly.
- Copy the result or download it as a .csv / .json file.
The flattening rules, with an example
Flattening is deterministic. Given this input:
[
{ "id": 1, "user": { "name": "Alice", "city": "Denver" }, "tags": ["a", "b"] },
{ "id": 2, "user": { "name": "Bob" }, "active": true }
]the tool produces these columns and rows:
id,user.name,user.city,tags[0],tags[1],active 1,Alice,Denver,a,b, 2,Bob,,,,true
- Objects flatten to
parent.childpaths; the separator is a literal dot. - Arrays flatten to
name[0],name[1]… — one column per index, sized by the longest array in the dataset. - Header order is first-seen order across all rows, so the column layout is stable for identically shaped inputs.
- Depth cap: beyond 10 nesting levels the remaining subtree is emitted as a JSON string in one cell, with a visible notice — silent data loss is worse than an ugly cell.
- null vs missing: both render as an empty cell in CSV. If that distinction matters downstream, CSV is the wrong interchange format.
Excel locale pitfalls worth knowing
A comma-delimited file double-clicked on a machine with a European regional format (where the comma is the decimal separator) opens as a single column, because that Excel expects semicolons. Exporting for a German or Dutch colleague? Choose the semicolon delimiter here. The reverse trap also exists: a semicolon file on a US-locale machine needs Data → From Text/CSV instead of a double-click. Separately, Excel silently converts values like 1E2 to 100, 01/02 to a date, and strips leading zeros from phone numbers and ZIP codes — if a column must stay literal, import it as text rather than opening the CSV directly.
Frequently asked questions
How are nested JSON objects converted to CSV columns?
Each nested key becomes a dot-separated column name. { "user": { "name": "Alice" } } produces a column called user.name. Arrays use bracket indices: { "tags": ["a", "b"] } produces tags[0] and tags[1]. Flattening stops at 10 levels of depth; anything deeper is serialized as raw JSON inside a single cell and the tool tells you it happened.
Why does my CSV open as one column of garbage in Excel?
Two common causes. First, locale: Excel installed with German, French, or most other European regional settings expects a semicolon delimiter, not a comma — switch the delimiter option to semicolon. Second, encoding: without a UTF-8 byte-order mark, Excel guesses the encoding and mangles non-ASCII characters. Keep the BOM toggle on when the file is destined for Excel; turn it off for programmatic consumers like pandas or PostgreSQL COPY, which may treat the BOM as part of the first header name.
What happens when objects in the array have different keys?
The header is the union of every key encountered, in first-seen order. Rows that lack a key get an empty cell for that column. This is the standard way to handle mixed-shape arrays, but note the asymmetry: on the way back, CSV → JSON cannot distinguish a key that was missing from a key whose value was an empty string.
Is the conversion lossless if I round-trip JSON → CSV → JSON?
Not always. CSV is a flat, typeless format. Type information survives only if you enable type inference on the way back, and even then a string like "00123" becomes the number 123, and "true" (the string) becomes a boolean. Nested structure is reconstructable from dot-notation column names in principle, but this tool returns flat objects — keep the original JSON if structure matters.
How are commas, quotes, and line breaks inside values handled?
Per RFC 4180: any field containing the delimiter, a double quote, or a newline is wrapped in double quotes, and embedded double quotes are doubled (" becomes ""). The CSV → JSON parser is a real state machine, so it correctly reads multi-line quoted fields that naive split-on-newline parsers destroy.
Is my data uploaded to a server?
No. Parsing, flattening, and file generation all use browser APIs (JSON.parse, Blob, URL.createObjectURL). You can disconnect from the internet after the page loads and the converter keeps working — useful for files containing personal data covered by HIPAA, CCPA, or GDPR.
Related tools
- XML ⇄ JSON ConverterConvert XML to JSON and JSON back to XML in your browser — attribute handling, repeated elements as arrays, and clear parse error messages.
- YAML ⇄ JSON ConverterConvert YAML to JSON and JSON to YAML instantly in your browser — multi-document support, error line numbers, and copy or download output.
- JSON Formatter & ValidatorFormat, validate, and beautify JSON in your browser — instant error messages with line numbers, 2 or 4-space indent, minify mode, and copy.
- GPA to Percentage ConverterConvert a 4.0-scale GPA to a percentage and back, with the standard US letter-grade mapping (A = 4.0). Includes a full conversion table.
- PX ⇄ REM ConverterConvert px to rem and rem to px instantly with any root font size — plus a full conversion table and CSS tips for accessible font sizing.
- Cups ⇄ Grams Converter (by Ingredient)Convert cups to grams by ingredient — flour, sugar, butter, rice, and 40+ more — with US and metric cup sizes and tablespoon equivalents.