JSON to CSV converter
Paste an API response, a JSON array or JSON Lines and get a CSV with one row per record and one column per field, including fields buried inside nested objects.
Loading the tool…How to use it
- Paste JSON, drop a .json / .jsonl file, or load the sample.
- Choose how nested objects and arrays should appear: dot-path columns or JSON text in a cell.
- Pick a delimiter and download the .csv.
Private by design
The conversion runs as JavaScript in this tab. Your data is not uploaded, logged or stored. There is no account and no file-size paywall.
How nested JSON becomes flat columns
A spreadsheet row is flat; a JSON record is a tree. Every converter has to decide how to squash the tree. Switch strategies and step through the record to see which column each value lands in.
{ "id": 7, "name": "Ada", "address": { "city": "London", "zip": "N1" }, "tags": ["math", "poetry"] }
| id | name | address.city | address.zip | tags.0 | tags.1 |
|---|---|---|---|---|---|
| 7 | Ada | London | N1 | math | poetry |
Where the rows come from
If the top level is an array, each item is a row. If it is an object that wraps a list (for example {"data": [...]} or {"results": [...]}), the first array of objects inside is used. A single object becomes a single row. JSON Lines files, with one object per line, are detected automatically.
Columns when records differ
Real API data is ragged: one record has a phone field, the next does not. The converter collects every key it sees, in first-seen order, and leaves blanks where a record lacks that field, so no data is dropped.
Opening the CSV in Excel
Excel on Windows guesses the file encoding and can garble accents like é or ü. Tick “Add UTF-8 BOM” and Excel reads it correctly. In countries where Excel expects semicolons (much of Europe), choose the semicolon delimiter or use the JSON to Excel converter to get a real .xlsx.
Convert JSON to CSV in code
In Python, pandas.json_normalize flattens nested objects into dot-separated columns, the same idea as the dot-path option above. On the command line, jq can emit CSV rows with its @csv filter.
import json
import pandas as pd
with open('input.json', encoding='utf-8') as f:
data = json.load(f)
df = pd.json_normalize(data) # nested keys -> address.city
df.to_csv('output.csv', index=False)One row per array item
When each record holds a list (orders with several items, users with several roles), “One row per array item” repeats the record once per element, like pandas explode or SQL UNNEST. The other fields are copied onto every row, so each line stays self-contained for filtering and pivot tables.
Questions
Is my file uploaded anywhere?
No. The file is read by JavaScript in this tab and never leaves your device. You can load the page, switch off Wi-Fi and it keeps working.
What happens to arrays inside records?
In dot-path mode, tags: ["a","b"] becomes columns tags.0 and tags.1. In JSON-text mode the whole array is kept in one cell as ["a","b"], which is easier to read when arrays are long.
My JSON has an error. Can this fix it?
Use the JSON validator: it points at the line and column of the problem and can suggest a repaired version.
Can I convert CSV back to JSON?
Yes. The CSV to JSON converter rebuilds nested objects from dot-path headers, so the round trip is lossless for most data.
How do I convert JSON to CSV in Excel?
In Excel for Windows use Data › Get Data › From File › From JSON, then expand the columns in Power Query. For a one-off file it is quicker to convert here and open the CSV, or use JSON to Excel for a ready .xlsx.
How do I handle nested JSON?
Choose dot-path columns to spread nested fields across columns, JSON text to keep each nested value in one cell, or one row per array item to unnest lists into extra rows.
Can I convert JSON Lines (NDJSON)?
Yes. Paste or drop a .jsonl / .ndjson file with one JSON object per line; it is detected automatically.