JSON to CSV
Paste a JSON array of objects, or a single object, and convert it to CSV in your browser. Choose dot, underscore or slash paths for nested keys, or keep nested objects as JSON in one cell. Arrays stay in one cell as JSON or joined values. Every key found across the records becomes a column, and you can switch columns off before downloading. Number literals keep their original digits. Use the reverse direction to turn CSV rows into JSON objects with Text, Smart or Numbers typing.
The CSV appears here, one row per record.
A nested object becomes one column per leaf key, joined with dot path, an array is written as JSON in a single cell, and a key a record does not have is an empty cell.
What happens to an awkward value
- id,user.name 1,Ava
- id,tags 1,"[""a"",""b""]"
- id,email 1,a@b.c 2,
Common questions
- How does a nested object become a column?
- By its path. With the dot rule, {"user": {"name": "Ava"}} becomes a column called user.name holding Ava. Underscore and slash write the same path with user_name or user/name, which is what you want when a key already contains a dot. The fourth option leaves the object alone and writes it as JSON in a single cell, so {"name":"Ava"} arrives in the spreadsheet as text you can parse later. An object with no keys in it keeps its column and shows {}.
- What happens to an array inside a record?
- It stays in one cell. An array never turns one record into several rows, because that would quietly change how many records your file has. By default the array is written as JSON, so ["beta","paid"] appears as ["beta","paid"], quoted by the CSV rules. Switch the array rule to Joined and the same value becomes beta; paid, with strings as plain text and anything that is itself an object written as JSON.
- My records do not all have the same keys. What then?
- Every key that appears anywhere becomes a column, in the order the keys are first seen, and a record that lacks one gets an empty cell. Nothing shifts left, and no record is dropped for having a key the first record did not. The column list under the tool shows every column found, and switching one off leaves it out of the copy and the download.
- Does it convert CSV back to JSON?
- Yes, on the same page: switch the direction and the CSV pane opens with the type controls beside it. Fields are read by RFC 4180, so a quoted field may hold the delimiter, a line break and doubled quotes. Text, the default, keeps every field as a string. Smart reads true, false, null and plain numbers. Numbers also reads 007 as 7. The header row becomes the keys, so a column called user.name stays one key named user.name rather than being rebuilt into a nested object.
- Will a long id or a leading zero survive?
- Yes. The JSON is read by a parser that keeps every number as the literal text it was written as, so 12345678901234567890 reaches the CSV with all twenty digits and 1.50 does not become 1.5. Coming the other way, a zip code like 007 stays a string in Text and Smart, and only converts when you choose Numbers. A literal too large to hold as a number, such as 1e999, is kept as text rather than turned into Infinity.
- Is anything uploaded?
- No. The parsing, the conversion and the download all happen in the page, with no request to any server and no account. That matters here more than for most formats, because the arrays people convert are usually API responses, exports and customer records. You can paste up to 5,000,000 characters, 100,000 records and 2,000 columns in one pass, and anything larger is refused with the numbers rather than cut short.
- What if the CSV or the JSON has a mistake in it?
- The message names it. Invalid JSON is reported with a line, a column and a cause: a trailing comma, a single-quoted string, a Python True. On the CSV side, a row whose field count does not match the header is named by its row number with both counts, and a quoted field that never closes says which row it started on. Duplicate keys inside one record are legal JSON, so the conversion goes ahead and the note says which key was written twice.
- Which delimiter does it use?
- The one you choose: comma, semicolon, tab or vertical bar, in both directions. Whichever is in force, the output is quoted by RFC 4180, so a field containing the delimiter, a double quote or a line break is wrapped in double quotes and its own quotes are doubled. Reading CSV, if the first line holds more of another delimiter than the one selected, the tool says so rather than switching behind your back.
- How do I convert a nested JSON file to CSV?
- Open the file in a text editor and paste its JSON here. Select a nesting rule: Dot path makes user.name, Underscore makes user_name, and Slash makes user/name. JSON string keeps the nested object in one cell. The tool accepts an array of objects or one object; if an API response wraps the rows in a data property, paste that property’s array. It does not fetch a URL or connect to an API.
- Does flattening JSON expand nested arrays into several rows?
- No. Each input object stays one row. Nested objects can become columns, but an array remains one cell, either JSON text or values joined with a semicolon and a space. It does not explode arrays, produce every combination of nested items or automatically normalize several related tables. Two paths that become the same column produce a warning; choose another path separator to keep them separate.
- Can I convert JSON Lines, several files or a very large export?
- This is a paste-based converter for one JSON value, with at most 5,000,000 characters, 100,000 records, 2,000 columns and 64 nesting levels. Separate JSON objects on successive lines are not one JSON array. There is no JSONL/NDJSON reader, multi-file batch or streaming conversion. Split a large source into valid smaller arrays before converting; it must still fit browser memory.
- How do I open the CSV in Excel without changing IDs?
- Download the CSV, then import code and identifier columns as text in your spreadsheet program. This converter preserves the source number digits, but the program opening CSV can still turn text into dates, numbers or formulas. For an XLSX file, pass the CSV to <a href="/spreadsheet-converter/csv-to-xlsx">Spreadsheet Converter</a> and check the inferred column types. The CSV contains values, not original Excel formatting or a workbook.
- Can I use it on Windows, Mac or Linux without installing a converter?
- Yes, in a current browser. Paste the source and download the result without an account. There is no desktop installer, browser extension, command-line program or guaranteed offline package. Small drafts up to 20,000 characters can be remembered in this browser; larger input still converts within the stated limits but is not saved as a draft.
Exact conversion of the records you give it: every key that appears becomes a column, a missing key becomes an empty cell rather than a shifted row, and the CSV is quoted by RFC 4180. Reversing the direction converts types only where you say so.