JSON to CSV Converter
Convert JSON arrays of objects into clean CSV. Flatten nested objects into dotted columns, handle arrays via JSON / pipe-join / first-item modes, pick delimiter and newline style. 100% client-side.
What is the JSON to CSV Converter?
JSON to CSV Converter takes any JSON input — an array of objects (the standard API-response shape), an array of arrays (the first one becomes the header), or a single object (output as a one-row CSV) — and emits clean, spreadsheet-ready CSV. Nested objects can be flattened into dotted columns (`address.city`, `address.country` …) or kept as JSON-stringified cells. Nested arrays inside cells have three handling modes: 'Stringify as JSON' (lossless, the default), 'Join with `|`' (human-readable, good for tag lists) or 'Take first item' (when only the first element matters). Pick the delimiter (comma / semicolon / tab / pipe), the newline style (LF or Excel-friendly CRLF) and whether to include the header row. The output respects RFC 4180 quoting — fields that contain the delimiter, a quote or a newline are quoted and embedded quotes are doubled. Header columns are the union of all keys, so rows with missing fields produce empty cells instead of crashing.
How to use it
- Paste your JSON — an array of objects is the standard shape.
- Pick the delimiter (comma is standard; Excel + locale-EU users may need semicolon).
- Toggle 'flatten nested objects' if you want dotted columns instead of JSON-stringified cells.
- Copy the CSV or download as .csv (use CRLF newline mode for clean Excel import).
Benefits
- Accepts arrays of objects, arrays of arrays (header-in-first-row), and single objects.
- Flatten nested objects into dotted columns (`address.city` etc.) or keep them as JSON cells.
- Three nested-array modes: JSON-stringify (lossless), join with `|` (readable), first-item (when only [0] matters).
- Header columns = union of all keys, so missing fields don't crash — they become empty cells.
- Four delimiters (comma / semicolon / tab / pipe) and two newline styles (LF / CRLF for Excel).
- Always-quote toggle for downstream tools that prefer every field wrapped in `"…"`.
- Include-header toggle for tools that get fed raw rows.
- RFC 4180 quoting (`""`-escapes for embedded quotes).
- Runs 100% in your browser — Toollyz has no server.
Frequently asked questions
What input shape does it accept?
Three shapes: (1) array of objects — the standard API response, becomes one CSV row per object; (2) array of arrays — the first array becomes the header; (3) single object — becomes a one-row CSV.
How does 'flatten nested objects' work?
Nested objects get dotted keys. `{ address: { city: 'London' } }` becomes the column `address.city`. Without flattening, the nested object is JSON-stringified into a single cell.
What about nested arrays?
Three modes: 'Stringify as JSON' (lossless — `["a","b"]`), 'Join with `|`' (readable — `a | b`), 'Take first item' (when only the first element matters).
Why use CRLF newlines?
Excel imports CSV cleanly with CRLF. LF works for most other tools but Excel sometimes interprets it as one giant row. Default is LF — switch to CRLF if you're heading to Excel.
What gets quoted?
Per RFC 4180: fields containing the delimiter, a double quote, or a newline. With 'Always quote' on, every field is wrapped — useful for downstream tools that always expect quotes.
What if rows have different fields?
We take the union of all keys across rows and use that as the header. Rows missing a field show an empty cell for that column. No crash.
What happens to null and undefined?
Both become empty cells. Booleans become `true` / `false`. Strings, numbers and JSON-stringified objects/arrays are passed through.
Does it preserve column order?
Mostly — we follow object key order (JavaScript insertion order). The first object's keys appear first; new keys from later objects append in the order they're discovered.
Can I pick specific columns?
Not via a UI selector — but if you preprocess your JSON to keep only the keys you want (or use `Object.fromEntries` to rename), the output reflects that exactly.
Will it round-trip through CSV to JSON?
Yes for flat data. Nested objects/arrays lose type info when round-tripped — the CSV cell becomes a string. Use the JSON-stringify nested-array mode and the typed-values option in CSV to JSON for the cleanest round-trip.
Is anything uploaded?
No. Conversion runs entirely in your browser.