About this tool
JSON is how APIs return data; CSV is how people open it in Excel, Google Sheets or a BI tool. This JSON to CSV converter turns an array of objects into rows and columns, flattens nested objects into dotted column names, and finds the data array inside a typical API response for you. It runs in your browser, so exported customer or order data never leaves your machine.
How to use it
- Paste JSON, drop a
.jsonfile, or click Open file. JSON Lines (one object per line) works too. - Choose the delimiter and options, then check the result in Table preview.
- Copy the CSV or download it as
data.csv. Turn on Excel-friendly download if the file will be opened in Excel.
How JSON becomes rows and columns
- An array of objects becomes one row per object. Columns are every key that appears in any object, in the order first seen; missing values are left empty.
- An API response such as
{"data": [ … ], "page": 1}is unwrapped: the converter uses the first property that holds an array of objects and tells you which one. - Nested objects are flattened:
{"address": {"city": "Pune"}}becomes a column calledaddress.city. Turn flattening off to keep the object as JSON text in one cell. - Arrays inside objects, such as
"tags": ["a", "b"], are written as JSON text in a single cell, because they can’t become columns without guessing. - An array of arrays is written as rows exactly as given, and
nullbecomes an empty cell.
This converter is the reverse of the CSV to JSON tool: with “Nest a.b columns” on there, dotted columns turn back into nested objects.
Opening the CSV in Excel
- Accented or non-English characters look garbled? Excel assumes your system’s legacy encoding unless the file starts with a byte-order mark. Excel-friendly download adds one.
- Everything lands in column A? Excel in many European locales expects semicolons. Choose Semicolon as the delimiter.
- Long numbers turn into 1.23E+15 or lose their leading zeros? That is Excel’s display, not the file. Use Data → From Text/CSV and set those columns to Text.
CSV injection
Spreadsheet apps treat a cell that starts with =, +, - or @ as a formula. If your JSON contains text typed by users, such as names or comments, a value like =HYPERLINK(…) could run when someone opens the file. If you share exports of user-supplied data, turn on Block spreadsheet formulas: it puts a ' in front of such text cells (numbers are left alone), as recommended by OWASP.
Convert JSON to CSV in code
import json
import pandas as pd
with open("data.json", encoding="utf-8") as f:
data = json.load(f)
# json_normalize flattens nested objects into "a.b" columns, like this tool
pd.json_normalize(data).to_csv("data.csv", index=False)# Header from the first object's keys, then one row per object (flat objects only)
jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json > data.csv# The parentheses make Windows PowerShell 5.1 send one row per array item
(Get-Content data.json -Raw | ConvertFrom-Json) |
Export-Csv data.csv -NoTypeInformation -Encoding utf8
# Nested objects are not flattened: they appear as @{city=Pune}FAQ
How do I convert JSON to CSV?
Paste a JSON array of objects into the box above. Each object becomes a row and each key a column. Copy the CSV or download it as data.csv.
How are nested objects handled?
They are flattened into dotted column names, so {"user": {"name": "Ada"}} becomes a user.name column. Arrays are kept as JSON text in a single cell.
Can I open the result in Excel?
Yes. Turn on "Excel-friendly download" so accented characters display correctly, and use semicolons if your Excel uses a comma as the decimal separator.
What if my objects have different keys?
Every key from every object becomes a column, in the order first seen. Rows without a value for a column get an empty cell.
Does it work with JSON Lines?
Yes. If the input is not a single JSON document, each line is parsed as its own JSON value.
Is my JSON uploaded anywhere?
No. The conversion runs in a background worker in your browser, so nothing is sent to a server.