What does the JSON to CSV converter do?
It flattens a JSON array of objects into CSV: the header row is the union of every key that appears in any object, and each object becomes one row. Objects don't all need the same keys — missing fields simply come out as empty cells rather than failing the conversion. Values containing commas, quotes, or newlines are quoted and escaped per the CSV convention (" doubled to ""), so the output opens cleanly in Excel and Google Sheets.
Everything runs locally in your browser. API responses containing user records or order data are never uploaded or logged — the conversion is safe for data you couldn't paste into a third-party service.
When to use it
The classic scenario is handing engineering data to non-engineers: an API returns JSON, but the person who asked for the report lives in spreadsheets. Convert, hit Download CSV, and send them a file that opens directly in Excel.
It's equally useful for eyeballing data yourself. A 200-element JSON array is hard to scan for outliers; the same data as CSV drops straight into a spreadsheet where you can sort and filter. And because the header row is the union of all keys, it doubles as a quick schema check — an unexpected column name in the output means some objects in your array have keys you didn't know about, which is often the bug you were hunting.
Example
Paste [{"name": "John", "age": 30}, {"name": "Jane", "age": 25, "city": "Oslo"}] and Convert produces:
name,age,city John,30, Jane,25,Oslo
Note how the city column exists because one object has it, and John's row just leaves it empty. Nested values are not expanded: an array lands in one cell as its items joined by commas, and a nested object comes out as the literal text [object Object], so flatten nested data first if you need one column per nested field. Use "Copy link to this result" to share a permalink that restores your exact input, or the companion CSV to JSON tool to go the other way.
Flattening nested JSON before converting
This converter maps top-level keys to columns and goes no deeper. An array value such as ["a", "b"] lands in one cell as a,b (quoted, because it contains a comma), and a nested object comes out as the literal text [object Object] — JavaScript's default string for an object. Nested records therefore need flattening first.
The usual approach is dot-path keys: {"user": {"name": "Ada", "address": {"city": "Oslo"}}} becomes {"user.name": "Ada", "user.address.city": "Oslo"}, one column per leaf value. Arrays need a decision: join them into one string (tags: "a;b"), spread them into numbered columns (items.0, items.1), or emit one row per array element with the parent fields repeated — the right choice for orders with line items.
With jq, one command produces dot-path keys for every leaf: jq '[.[] | [paths(type != "object" and type != "array") as $p | {key: ($p | map(tostring) | join(".")), value: getpath($p)}] | from_entries]' data.json. Paste its output here and the union-of-keys header picks up every column, even when some records are missing a field.
JSON to CSV in Python, and opening the result in Excel
If the conversion belongs in a script, pandas does both steps: df = pandas.json_normalize(records) flattens nested objects into dot-path columns, and df.to_csv("out.csv", index=False, encoding="utf-8-sig") writes the file. For one row per nested array element, json_normalize(records, record_path="items", meta=["id", "customer"]) repeats the parent fields on each line. For flat records the standard library is enough: collect the union of keys, then csv.DictWriter(f, fieldnames=keys, restval="") writes missing fields as empty cells — the same behaviour as this page.
CSV is also the answer when someone asks for JSON in Excel: the downloaded file opens as a sheet. The catch is encoding. The download here is UTF-8 without a byte-order mark, and desktop Excel on Windows may guess the wrong encoding and turn é into é. If that happens, import through Data > From Text/CSV and pick 65001: Unicode (UTF-8), or open the file in Google Sheets, which reads UTF-8 correctly. In Python, encoding="utf-8-sig" writes the BOM so Excel gets it right on double-click.
Also watch long numeric IDs: Excel keeps only 15 significant digits and shows big numbers in scientific notation, so import such columns as Text.
How to use the JSON to CSV Converter with Headers from Every Key tool
- 1
Paste a JSON array
The input must be an array of objects — an API response body or a database export works well.
- 2
Convert
Headers are built from the union of all keys; missing fields become empty cells.
- 3
Copy or download
Copy the CSV text, or use Download CSV to save a file that opens directly in Excel or Google Sheets.
- 4
Share if needed
Copy a permalink that restores your exact input for anyone who opens it — the data stays in the link, not on a server.
Frequently asked questions
Why do I get "Input must be a JSON array"?
The converter needs an array of objects at the top level. If your API wraps results like {"data": [...]}, paste just the inner array. A single object can be converted by wrapping it in brackets: [{...}].
How are nested objects handled?
They aren't expanded into columns. An array value becomes its items joined by commas in a single quoted cell, and a nested object is written as the literal text [object Object] — JavaScript's default string for an object. CSV is flat, so flatten the JSON first (e.g. turn user.address.city into a top-level user.address.city or user_city key); the section on flattening above shows how.
Is my data sent to a server?
No. Conversion and the CSV download are generated entirely in your browser — nothing is uploaded, and permalinks carry the data in the URL fragment, which is never transmitted to the server.
Can I convert CSV back to JSON?
Yes — the companion CSV to JSON tool does the reverse: header row in, array of objects out, with selectable delimiters for semicolon and tab-separated files.
Can I convert JSON to Excel (XLSX)?
Not directly to .xlsx, but the CSV download opens in Excel as a normal sheet. Use File > Save As > Excel Workbook to turn it into an .xlsx file. If accented characters look wrong after opening, import it through Data > From Text/CSV with UTF-8 selected.
How are null, missing and boolean values written?
A null value and a key that is missing from an object both become an empty cell. Booleans and numbers are written as their text form — true, false, 42, 3.14 — without quotes.
What delimiter does the CSV use?
Always a comma, with rows separated by newlines. In locales where Excel expects semicolons (much of Europe), double-clicking may put each whole row into column A; import through Data > From Text/CSV and choose comma as the delimiter instead.
In what order do the columns appear?
In order of first appearance: the first object's keys come first, then any new keys from later objects are appended as they are encountered. Rows keep the order of the input array.
Related on TechLogHub
Related Converter Tools
Unix Timestamp Converter with Milliseconds
Convert Unix timestamps to human-readable dates and vice versa
Cron Expression Generator with Next Run Times
Build, explain and test cron expressions, with the next run times in UTC and your timezone
ENV to JSON
Convert .env files to JSON format
ENV to Docker Compose
Convert .env files to docker-compose environment snippet
Query String to JSON
Parse URL query strings into JSON objects
JSON to Query String
Convert JSON objects to URL query strings
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.