Z

JSON ↔ CSV Converter

Convert between JSON arrays and CSV in your browser. Handles nested keys and quoting.

Runs in your browser — files never leave your device

Output

How it works

This converter turns a JSON array of objects into comma-separated values and back, entirely in your browser. Click JSON → CSV and the input is parsed (a single object is treated as a one-row array), the column headers become the union of every key found across all objects in first-seen order, and each row fills its cells from the matching keys — objects that lack a key simply leave that cell empty.

Cell encoding follows the CSV convention spreadsheets expect (RFC 4180): values are joined with commas, a cell is wrapped in double quotes only when it contains a comma, a quote, or a line break, and embedded quotes are doubled. Nested data is not flattened into dotted columns — an object or array value is serialized as a JSON string inside a single cell, so a row like {"user":{"name":"Ada"}} produces a user column holding the quoted text {"name":"Ada"}. A null value becomes an empty cell.

A concrete example: converting [{"name":"Ada","role":"engineer"},{"name":"Bo","city":"Oslo"}] yields exactly three lines — the header name,role,city, then Ada,engineer, with an empty city, then Bo,,Oslo with an empty role. That union-of-keys rule is what lets arrays of uneven objects convert without errors.

CSV → JSON reads the first non-blank line as the header and returns an array of objects with one property per column. Every value comes back as a string — 36 becomes "36" — because CSV carries no type information and the parser does not guess. Quoted cells with embedded commas, line breaks, or doubled quotes are handled, LF and CRLF endings both work, blank lines are skipped, and short rows are padded with empty strings. The delimiter is the comma only; semicolon- or tab-separated files will not split.

Typical uses: dropping an API response into Excel or Google Sheets, turning a spreadsheet export into JSON fixtures or seed data for tests, and eyeballing a JSON array as a table. Flat data round-trips cleanly; the two gotchas to remember are that nested structures come back as JSON strings rather than objects, and that every value returns as a string.

Frequently asked questions

What JSON shape does the converter expect?
A JSON array of objects, one object per CSV row. A single object also works and becomes a one-row CSV. Column headers are the union of every key found across all objects, in the order they first appear, and rows that lack a key get an empty cell.
Does it flatten nested objects into dotted columns?
No. A nested object or array is serialized to a JSON string inside one CSV cell, so a user object becomes a single user column containing {"name":"Ada"} rather than a user.name column. Flatten the structure yourself first if you need one column per nested field.
How are commas and quotes inside values handled?
Following the CSV convention (RFC 4180), a cell is wrapped in double quotes only when it contains a comma, a double quote, or a line break, and embedded quotes are doubled — say "hi" becomes "say ""hi""". The CSV parser applies the same rules in reverse, so quoted commas and multi-line cells survive the trip back.
Do numbers and booleans survive a round trip?
JSON → CSV keeps their text form, but CSV → JSON returns every value as a string: 36 comes back as "36" and true as "true". CSV carries no type information and the parser does not guess. Convert types downstream if you need real numbers or booleans.
Can I use semicolons or tabs as the delimiter?
No — this converter reads and writes comma-separated data only. Semicolon-delimited exports (common from Excel in some European locales) and tab-separated files will not split into columns; convert them to commas first.
Which line endings and edge cases does the CSV parser accept?
Both LF and CRLF line endings are recognized, completely blank lines are skipped, rows shorter than the header are padded with empty strings, and extra cells beyond the header are ignored. The first non-blank row is always treated as the header.
Is my data uploaded anywhere?
No. Parsing and conversion run entirely in your browser with no network request, so the data never leaves your device — close or refresh the page and it is gone.