You have a JSON file from an API, an app export or a developer, and someone needs it in a spreadsheet. JSON is great for software and hard for people: it’s nested, full of brackets, and Excel won’t open it as a table. CSV is the opposite. It’s flat, plain rows and columns, and every spreadsheet reads it.
This guide shows how to convert JSON to CSV in under a minute with a free tool, what happens to nested data and lists along the way, and how to avoid the mistakes that silently damage your data, like zip codes losing their leading zero.
The quick answer
- Open Doetra’s free JSON to CSV converter.
- Paste your JSON or drop the file (up to 25 MB).
- Pick CSV as the output and check the table preview.
- Click Download and open the file in Excel or Google Sheets.
No sign-up, no daily limit, and your file is never uploaded. The conversion runs in your browser, on your own device.
JSON vs CSV in one minute
JSON (JavaScript Object Notation) stores data as objects with named fields. Fields can hold other objects or lists, so one record can go several levels deep:
[
{
"id": 1,
"name": "Ada Lovelace",
"zip": "02134",
"address": { "city": "London" },
"tags": ["math", "poetry"]
},
{
"id": 2,
"name": "Grace Hopper",
"zip": "10001",
"address": { "city": "New York" },
"tags": ["navy"]
}
]CSV (comma-separated values) is a flat table: one header row, then one line per record, with values separated by commas. There’s no nesting, so nested JSON has to be flattened first. That’s the step that trips most people up.
| JSON | CSV | |
|---|---|---|
| Shape | Nested objects and lists | Flat rows and columns |
| Best for | APIs, apps, config files | Spreadsheets, reports, imports |
| Opens in Excel | Not as a table | Yes, directly |
| Data types | Text, numbers, true/false, null | Everything is text |
Why you’d convert JSON to CSV
- Share data with non-developers. A manager, client or accountant can open a CSV; they can’t read raw JSON.
- Analyse API exports. Orders, sign-ups, analytics events or product feeds often come out of an API as JSON. In a spreadsheet you can sort, filter and build pivot tables.
- Import into other tools. CRMs, email platforms, Shopify, WooCommerce and Google Ads all take CSV imports.
- Clean data by hand. Spotting a bad row is much easier in a grid than in thousands of lines of brackets.
Step by step: convert JSON to CSV with Doetra
1. Add your data
Go to doetra.com/json-to-csv. Paste JSON straight into the editor, drop a .json file onto the page, or click Open a file. Doetra recognises the format for you. Not sure what it does? Click Try a sample first.
2. Choose CSV as the output
Pick CSV. You can view the result as raw code or as a table. The table view is the fastest way to check that every column landed where you expect. If your JSON has a syntax error, such as a missing comma or an extra bracket, Doetra points to the line, so you can fix it instead of guessing.
3. Download, copy or share
Download the CSV file, copy it to your clipboard, or create a share link. The data lives inside the link itself, so nothing is stored on a server, and the link doesn’t expire.
What happens to nested objects and lists
This is where JSON to CSV converters differ most. Doetra’s converter follows three simple rules:
- Each object in the top-level list becomes one row.
- Nested objects become dotted columns.
{"address": {"city": "London"}}becomes a column calledaddress.city. Deeper levels keep adding dots, for exampleaddress.geo.lat. - Lists are kept as JSON text inside the cell.
"tags": ["math", "poetry"]becomes["math","poetry"]in a singletagscell, so no value is lost and you can split it later if you need to.
So the example above turns into this table:
| id | name | zip | address.city | tags |
|---|---|---|---|---|
| 1 | Ada Lovelace | 02134 | London | [“math”,”poetry”] |
| 2 | Grace Hopper | 10001 | New York | [“navy”] |
If records don’t all have the same fields, which is common with API data, every field that appears anywhere gets its own column, and records without it leave that cell empty.
Keep leading zeros and exact values
Zip codes, phone numbers, product codes and IDs often start with a zero. If anything along the way treats "02134" as a number, it becomes 2134, and you may not notice until a delivery goes to the wrong place.
Doetra converts by code, so every value comes out exactly as it went in: 02134 stays 02134. One thing to watch: Excel itself can still drop leading zeros when you double-click a CSV to open it. To keep them, open Excel first and use Data → From Text/CSV, then set those columns to Text. Google Sheets has the same option under File → Import (untick “Convert text to numbers, dates and formulas”).
Why not just ask an AI chatbot?
It’s tempting to paste JSON into a chatbot and ask for a CSV. For a handful of rows it might work. For real files there are two problems:
- It stops partway. A chatbot retypes your data as text, and long replies get cut off, so the last rows simply go missing.
- It can quietly change values. A zip code loses its zero, a long number gets rounded, a name gets “corrected”. You won’t see an error; the data is just wrong.
A converter like Doetra doesn’t retype anything. It parses the file and writes every row, all the way to the last one, up to 25 MB.
Other ways to convert JSON to CSV
| Method | Good for | Drawbacks |
|---|---|---|
| Doetra JSON to CSV (online, in-browser) | Anyone; quick one-off conversions up to 25 MB | Not for automated, repeated jobs |
| Excel Power Query (Data → Get Data → From JSON) | Excel users who refresh the same file regularly | Expanding nested columns takes several clicks per level |
Python with pandas (json_normalize then to_csv) | Developers, scheduled scripts, very large files | Needs Python installed and some code |
| jq on the command line | Developers working in a terminal | You write the column mapping yourself |
Common problems and fixes
- “Invalid JSON” error. Look at the line Doetra highlights. The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, or a missing closing bracket.
- Only one row comes out. Your JSON is a single object rather than a list. If the records sit inside a field, like
{"data": [ ... ]}, paste just the list insidedata. - Accented or non-English text looks garbled in Excel. Import with Data → From Text/CSV and choose UTF-8 encoding instead of double-clicking the file.
- Too many columns. Deeply nested data creates many dotted columns. Delete the ones you don’t need in the spreadsheet, or trim the JSON before converting.
Is it safe to convert JSON online?
With most online converters, your file is uploaded to their server. That’s a problem if it holds customer emails, orders or anything confidential. Doetra is different: everything is converted in your browser, on your own device, and nothing is sent to a server. Even share links carry the data inside the link itself.
More than JSON to CSV
The same tool works in every direction. Doetra reads JSON, YAML, CSV, TSV, XML and TOML, and writes all six, plus TypeScript types, Zod schemas, JSON Schema, SQL inserts and Markdown tables. Need the reverse? Use Doetra and pick CSV as the input and JSON as the output.
FAQ
How do I convert JSON to CSV for free?
Open doetra.com/json-to-csv, paste your JSON or drop the file, choose CSV, and download. It’s free, with no sign-up and no watermark.
Is there a file size limit?
Files up to 25 MB, with no daily cap. You can convert as many files as you like.
How are nested JSON objects handled?
Nested objects become dotted column names such as address.city. Lists are kept as JSON text in a single cell, so nothing is lost.
Will my zip codes and IDs keep their leading zeros?
Yes. Doetra copies every value exactly. To keep the zeros in Excel too, import the file with Data → From Text/CSV and set those columns to Text.
Is my data uploaded anywhere?
No. The conversion happens in your browser, on your device.
Ready? Convert your JSON to CSV with Doetra → It’s free, private, and takes about a minute.