The fastest way to convert JSON to CSV is to paste or load a JSON array of objects into a converter that turns each object into a row and each key into a column. If the data is flat, that takes seconds. If it contains nested objects or lists, you have to decide how to flatten them first, and that decision matters more than the tool you pick. This guide covers both: the quick route, the command-line and Python routes, and the checks that tell you the conversion kept your data intact.
TL;DR
- JSON is hierarchical and CSV is a flat table, so conversion works cleanly when your JSON is an array of objects with the same keys.
- For a quick job, use our JSON to CSV converter. It runs in your browser, needs no account and does not upload your file.
- Nested objects become columns, nested lists need a decision (extra rows, a separate table, or a JSON string in a cell), and commas, quotes and line breaks in values must be escaped properly.
- Always verify the result: compare row counts, check a few records by hand and open the file in the program that will actually use it.
- Going the other way, CSV to JSON, mostly comes down to headers, delimiters and data types.
Table of Contents
- What JSON and CSV actually are
- The quickest method: a browser converter
- Before you convert: look at the shape of your data
- Handling nested objects and arrays
- Converting JSON to CSV with code
- Commas, quotes, line breaks and encoding
- Converting CSV to JSON
- Checking that nothing was lost
- Common conversion errors and how to fix them
- When your source is not JSON at all
- Try it on your own file
- FAQ
- Sources
What JSON and CSV actually are
JSON stores data as nested structures: objects with named keys, arrays of values, and objects inside objects. CSV stores a grid: one record per line, fields separated by a delimiter, usually a comma, and optionally a header line naming the columns. The NCBI's reference on JSON and tabular formats describes JSON as structured, hierarchical data and CSV/TSV as tabular, and it warns that weak standards compliance can lead to errors and corruption when files are parsed.
That difference explains every problem you will meet. A grid has no place for "a list of three phone numbers inside one customer." JSON does. Converting from JSON to CSV means squeezing a tree into a table. Converting from CSV to JSON means giving a table some structure it never had.
People convert between them for ordinary reasons:
- JSON to CSV: you pulled data from an API or an app export and want to read it, filter it or chart it in a spreadsheet.
- CSV to JSON: you have spreadsheet data and a website, script or import tool that expects JSON.
- Handing data to someone else: a colleague who lives in spreadsheets needs the export in a format they can open with a double click.
The quickest method: a browser converter
For a one-off conversion, a browser tool is the simplest path. With ours, the steps are:
- Open the JSON to CSV converter.
- Paste your JSON array of objects, or load your file.
- Run the conversion and review the resulting table.
- Copy or download the CSV and open it in your spreadsheet program.
The tool is built for an array of objects, the shape most APIs and exports produce. It looks like this:
[
{"id": 1, "name": "Ada", "city": "Austin"},
{"id": 2, "name": "Grace", "city": "Boston"}
]
and becomes:
id,name,city
1,Ada,Austin
2,Grace,Boston
Because the processing happens locally in your browser, the file is not sent to a server. That is worth caring about when the data holds customer names, order details or internal figures.
If your JSON will not convert, the usual reason is a syntax error: a trailing comma, a missing quote or a stray bracket. Run it through the JSON formatter and syntax validator first. It pretty-prints valid JSON and points to the place where invalid JSON breaks, which is much easier than hunting through a single 40,000-character line.
Before you convert: look at the shape of your data
Open the JSON and answer three questions.
Is the top level an array of objects? A list like [{...}, {...}] maps naturally to rows. A single object with a big array buried inside it, such as {"status": "ok", "results": [...]}, means you should convert the results array, not the wrapper.
Do all objects share the same keys? If some records have fields others lack, the table needs a column for every key that appears anywhere, with empty cells where a record has no value. A converter that builds its header from only the first record will silently drop fields that appear later. Scan a few records from the middle and the end, not just the top.
Is anything nested? Look for curly braces or square brackets inside a record. That is where the decisions begin.
Handling nested objects and arrays
There is no single correct way to flatten nested JSON. There are three common patterns, and the Fivetran data-handling documentation describes them well: flatten a single nested object into columns, break a list of nested objects into child tables, or store complex or variable nested data as a JSON blob.
| Your data | Typical approach | Result |
|---|---|---|
An object inside a record (address: {city, zip}) | Flatten into columns | address.city, address.zip |
A list of simple values (tags: ["a","b"]) | Join into one cell or keep as a JSON string | One column with a;b or ["a","b"] |
A list of objects (items: [{sku, qty}, ...]) | Expand into one row per item, or a second CSV | Parent fields repeat, or two linked files |
| Variable, irregular structure | Keep as a JSON string in one cell | One column you parse later |
The row-per-item choice has a side effect people forget: parent fields repeat. An order with three line items becomes three rows, each carrying the order ID. If you then sum an order-level column, such as shipping cost, you will count it three times. Where totals matter, a two-file approach (orders in one CSV, items in another, linked by order ID) keeps the arithmetic honest.
A practical rule: flatten what you will filter or sort on, and leave the rest as a JSON string in a single cell. You lose nothing, and you can parse that cell later.
Converting JSON to CSV with code
When you convert the same kind of file every week, a script saves time. Two approaches cover most needs.
jq on the command line
The jq manual documents the @csv format, which renders an array as a CSV line, quotes strings and escapes embedded quotes by doubling them. A typical command selects fields, writes a header and then emits rows:
jq -r '(["id","name","city"] | @csv), (.[] | [.id, .name, .city] | @csv)' data.json > data.csv
The Baeldung guide to JSON to CSV on Linux walks through this with jq and with Python's csv module. The key point from both: let a CSV-aware function write the output. Do not build lines by joining strings with commas.
Python and pandas
In Python, pandas handles flat and nested data. For nested records, the json_normalize function flattens dictionaries or lists of dictionaries. Nested paths become dotted column names, record_path expands a nested list into rows, and meta repeats chosen parent fields on each of those rows. Then DataFrame.to_csv writes the file. It can select columns and write the header, and it includes the row index by default, so pass index=False unless you want that extra first column.
import json, pandas as pd
with open("data.json", encoding="utf-8") as f:
data = json.load(f)
df = pd.json_normalize(data)
df.to_csv("data.csv", index=False, encoding="utf-8")
For a nested list, add record_path="items" and meta=["order_id"] so each item gets its own row tagged with its parent.
Commas, quotes, line breaks and encoding
Most broken CSV files come from values that contain the characters CSV uses as structure. The RFC 4180 specification, the closest thing CSV has to a formal definition, says fields containing commas, double quotes or line breaks should be enclosed in double quotes, and a double quote inside a field is escaped by another double quote.
So the JSON value He said "hi", then left becomes this CSV field:
"He said ""hi"", then left"
A good converter does this for you. A hand-built script that just joins with commas does not, and the damage appears as shifted columns: every row after the first comma in a text field lands one cell to the right.
Delimiters. Some regions and programs use semicolons instead of commas, because the comma is the decimal separator in many countries. If your CSV opens as one fat column, the delimiter is the culprit. The CSV viewer lets you preview a file and its delimiter before you import it.
Encoding. JSON is Unicode text. Save the CSV as UTF-8 so accents, symbols and non-Latin scripts survive. Some spreadsheet programs guess the wrong encoding when you double-click a UTF-8 CSV and show garbled characters. Importing the file through the program's text-import option and choosing UTF-8 usually fixes it.
Numbers that are really identifiers. ZIP codes with leading zeros, long order numbers and phone numbers are text, not quantities. Spreadsheet programs often strip the zeros or switch long numbers to scientific notation when they open a CSV. Import those columns as text.

Converting CSV to JSON
The reverse direction has its own checklist. A converter reads the header row for key names and turns each following line into an object. Our CSV to JSON array converter does exactly that and returns an array of objects you can drop into a script, a config or an API request.
Things to settle before you convert:
- A clean header row. Duplicate or blank column names produce duplicate or missing keys. Rename them first.
- The right delimiter. A semicolon-separated file read as comma-separated yields one giant key.
- Data types. CSV has no types: everything is text. Decide whether
007,trueor2026-11-06should become a number, a boolean, a date or stay a string. The W3C recommendation on generating JSON from tabular data treats this as a transformation guided by metadata, with JSON-reserved characters in values escaped according to the JSON specification. - Empty cells. Decide whether an empty cell becomes an empty string,
nullor a missing key. Whatever you choose, apply it consistently, because the program reading the JSON will probably treat them differently.
If the CSV is messy, tidy it before converting. The CSV cleaner prepares a file for import, and the column selector lets you keep and reorder only the columns you need, so the JSON does not carry fields nobody asked for. For a very large export, splitting the CSV by row count keeps each piece manageable.
Our perspective
We built Fixora around a simple observation: most people who need to convert a file need it once, right now, and do not want to install software or create an account to do it. JSON and CSV files also tend to hold exactly the kind of data you would rather not upload anywhere: customer lists, exports from internal systems, test data.
That is why our converters run locally in your browser. Your file is read on your own device, and the result appears next to it. We think that is the right default for data work, and it is the reason our JSON and CSV tools sit together: validate the JSON, convert it, clean the CSV, compare two exports, all without a download or a sign-up.
The best conversion is the one you can check. That is why we keep each tool narrow. The JSON to CSV tool takes an array of objects and gives you a table. The CSV to JSON tool takes a table and gives you an array. When something looks off, you can see where, fix the source and run it again in seconds.
IA
Checking that nothing was lost
Conversion errors are quiet. The file opens, the columns look plausible, and a third of the records are subtly wrong. A five-minute check catches most of it:
- Count the records. The number of objects in the JSON array should equal the number of data rows in the CSV, excluding the header. If you expanded a nested list, the row count should equal the total number of items instead.
- Check the columns. The header should list every key that appears anywhere in the JSON, not just in the first record.
- Spot-check three records. Take the first, one from the middle and the last, and compare them with the source by eye. Include one with a comma, quote or accent in a text field.
- Check blanks. Look at columns that had missing values in the JSON. Blank cells should line up with missing keys, not with shifted data.
- Round-trip a sample. Convert a small slice back to JSON and compare. If you stored nested data as a JSON string in a cell, parse a few of those cells to confirm they are still valid.
- Open it where it will be used. A file that looks fine in a text editor may misbehave in a spreadsheet or an import screen.
To compare two versions of an export, for example before and after a conversion round trip, the CSV comparison tool matches files by a key column and shows what was added, removed or changed. The CSV and JSON workflow page gathers the cleaning, comparing and converting tools in one place.
Common conversion errors and how to fix them
| Symptom | Likely cause | Fix |
|---|---|---|
| Converter reports invalid JSON | Trailing comma, single quotes, missing bracket, or a text prefix before the first [ | Validate and format the JSON, correct the reported spot |
| Only one column, or one giant cell | Wrong delimiter | Preview the file and choose the matching delimiter |
| Values shifted to the right in some rows | Unescaped comma, quote or line break in a text field | Re-export with a CSV-aware writer that quotes fields |
| Some fields are missing from the CSV | Header built from the first record only | Make sure the header covers the union of all keys |
Cells show [object Object] or similar | A nested object was not flattened | Flatten to dotted columns or keep as a JSON string |
| Garbled accents or symbols | Encoding mismatch | Save as UTF-8 and import with UTF-8 selected |
| Leading zeros vanished | Spreadsheet treated an ID as a number | Import the column as text |
| Extra first column of numbers | Row index written by the library | Turn the index off when writing, such as index=False in pandas |
| JSON from a CSV has all values as strings | CSV carries no types | Convert types after, or choose a tool setting that detects them |
| Huge file is slow or will not open | Too many rows for the program | Split by row count or filter to the rows you need with the row filter |
One more case: a file that looks like JSON but holds one object per line (often called JSON Lines). It is not a single valid JSON document. The NCBI guide above covers the difference. Either wrap the lines in an array with commas between them or use a tool that reads line-delimited records.
When your source is not JSON at all
Sometimes the data starts as a plain list: email addresses pasted from a message, names one per line, IDs copied from a ticket. The text list to CSV converter turns that into a CSV in a click, which you can then convert to a JSON array if you need one.
Try it on your own file
If you have a JSON export open in another tab, you can convert it now. Our JSON to CSV converter takes an array of objects and returns a CSV, entirely in your browser, with no account and no upload. The same suite includes a CSV to JSON converter and a JSON validator. Browse all 40 free tools on the Fixora tools page.

Whatever tool you use, run the checks above before you send the file on. A converted file that nobody verified is where most downstream data problems start.
FAQ
How do I convert JSON to CSV without losing data?
Start with an array of objects, make sure the header covers every key, and decide how nested values will be handled before you convert. Afterward, compare the record count and spot-check a few rows, including ones with commas, quotes or accents. Anything you cannot flatten sensibly can stay in one cell as a JSON string.
Can I convert JSON to CSV without uploading my file?
Yes. A browser-based tool such as our JSON to CSV converter processes the data locally on your device, so the file is not sent to a server. Command-line tools like jq and libraries like pandas also work entirely on your own machine.
What happens to nested JSON when it becomes CSV?
A nested object can be flattened into columns with dotted names. A list of nested objects can be expanded into extra rows, split into a second table, or stored as a JSON string in one cell. Which one is right depends on what you will do with the CSV next, as the table in this guide shows.
How do I convert CSV to JSON?
Make sure the first row holds unique column names, confirm the delimiter, then run the file through a converter such as our CSV to JSON tool. You get an array with one object per row. Check afterward whether numbers, booleans and empty cells came out the way your application expects.
Why does my CSV look wrong in a spreadsheet after conversion?
The usual causes are a delimiter the program did not expect, an encoding mismatch that garbles accents, or identifiers such as ZIP codes being read as numbers. Import the file through the program's text-import option, choose UTF-8 and the right delimiter, and set ID columns to text.
Sources
- Summary of JSON, JSON Lines, and CSV/TSV tabular formats (NCBI)
- Connector SDK Concepts: Data Extraction and Handling (Fivetran)
- jq 1.8 Manual
- How to Convert JSON to CSV in Linux (Baeldung)
- pandas.json_normalize documentation
- pandas.DataFrame.to_csv documentation
- RFC 4180: Common Format and MIME Type for CSV Files
- Generating JSON from Tabular Data on the Web (W3C)
