JSON to CSV Converter: Convert JSON to CSV and CSV to JSON Online
Paste JSON, get a clean spreadsheet-ready CSV. Need to go the other way? The same tool turns CSV back into JSON. Nested objects are flattened for you, and nothing leaves your browser.
Convert JSON to CSV online
Place your tool embed here (input box, delimiter selector, preview table, download button).
What is a JSON to CSV converter?
JSON (JavaScript Object Notation) is the standard format for API responses, configuration files and database exports. CSV (comma-separated values) is the flat, row-and-column format that spreadsheets, BI tools and import screens expect. A JSON to CSV converter reads the structured JSON and writes it out as a table, so you can open it in Excel or Google Sheets, filter it, chart it or load it into another system.
The two formats work differently. JSON can hold objects inside objects and lists inside lists; CSV cannot. That is why a good converter has to decide how to flatten nested data, quote values that contain commas, and keep the header row consistent when some records have keys that others lack. This tool handles those details so the JSON format to CSV step is quick and predictable.
How to convert JSON to CSV in four steps
- Add your JSON. Paste it into the editor or upload a
.jsonfile. The input is validated as you type, and parse errors point to the problem line. - Pick your options. Choose a comma, tab, semicolon or pipe delimiter and decide how nested objects and arrays should be flattened.
- Check the preview. The first rows appear as a table so you can confirm the columns before exporting.
- Download or copy the CSV. Open it in Excel, Google Sheets, LibreOffice or any import tool.
Features that make the conversion reliable
Nested JSON flattening
Objects become dotted columns like user.address.city. Arrays can be joined or split.
Four delimiters
Comma, tab, semicolon or pipe, so the file opens correctly in your regional Excel.
Private by design
Conversion happens in your browser. Your JSON is not sent to a server.
Live table preview
See the first rows before you download, and spot odd columns early.
Two-way conversion
Switch between JSON to CSV and CSV to JSON without leaving the page.
RFC 4180 output
Fields with commas, quotes or line breaks are quoted and escaped correctly.
Converting nested JSON to CSV
Real API data is rarely flat. Take this record:
{
"id": 7,
"name": "Mira",
"address": { "city": "Dhaka", "zip": "1207" },
"tags": ["admin", "beta"]
}
With the default settings it becomes one row with these columns:
| id | name | address.city | address.zip | tags |
|---|---|---|---|---|
| 7 | Mira | Dhaka | 1207 | admin|beta |
If you want to inspect or tidy the source first, run it through our JSON minify and beautify formatter. Valid, readable JSON converts more predictably.
Why use this JSON to CSV converter?
- Faster than writing a script. A one-off export should not need a pandas environment or a jq one-liner you have to look up.
- Safer for sensitive data. Customer lists, order exports and API responses stay on your device.
- Spreadsheet-ready. Product catalogs, WooCommerce order exports, analytics responses and log data become something a non-developer can sort and filter.
- Consistent columns. Records with missing keys still line up under one header row, with empty cells where values are absent.
- No account, no size nag. It is free, and large files are limited only by your browser’s memory.
The same logic applies on the server side. If your WordPress or PHP project already produces JSON (for example from json_encode()), converting it to CSV is a practical way to hand data to clients, accountants or marketing tools. Moving between PHP arrays and JSON? Use our PHP and JSON tools together with this converter.
CSV to JSON: going the other direction
Paste CSV with a header row and the converter returns an array of objects, one per line, with the headers as keys. Numbers and booleans are detected automatically, and dotted headers such as address.city can be rebuilt into nested objects. This is handy for seeding a database, mocking an API response or feeding a spreadsheet export into a JavaScript app. If you also work with XML feeds, try the XML to JSON converter first and then export the result here.
JSON to CSV in Python, PHP, JavaScript and the command line
Prefer code? These are the common approaches, and they are useful for automating what the online tool does by hand.
Python (pandas)
import json, pandas as pd
with open("data.json", encoding="utf-8") as f:
data = json.load(f)
df = pd.json_normalize(data) # flattens nested keys
df.to_csv("data.csv", index=False, encoding="utf-8-sig")
Python (standard library only)
import csv, json
rows = json.load(open("data.json", encoding="utf-8"))
with open("data.csv", "w", newline="", encoding="utf-8") as f:
w = csv.DictWriter(f, fieldnames=rows[0].keys())
w.writeheader()
w.writerows(rows)
PHP
<?php
$rows = json_decode(file_get_contents('data.json'), true);
$out = fopen('data.csv', 'w');
fputcsv($out, array_keys($rows[0]));
foreach ($rows as $row) {
fputcsv($out, $row);
}
fclose($out);
JavaScript (Node.js)
const fs = require("fs");
const rows = JSON.parse(fs.readFileSync("data.json", "utf8"));
const cols = Object.keys(rows[0]);
const esc = v => `"${String(v ?? "").replace(/"/g, '""')}"`;
const csv = [cols.join(","), ...rows.map(r => cols.map(c => esc(r[c])).join(","))].join("\n");
fs.writeFileSync("data.csv", csv);
Command line (jq and PowerShell)
# jq jq -r '(.[0] | keys_unsorted) as $k | $k, (.[] | [.[$k[]]]) | @csv' data.json > data.csv # PowerShell (no third-party tools) Get-Content data.json -Raw | ConvertFrom-Json | Export-Csv data.csv -NoTypeInformation
For reference, see the Python csv module, pandas.json_normalize, PHP’s fputcsv(), the jq manual and Microsoft’s Export-Csv documentation.
Online converter or code: which should you use?
| Situation | Best choice |
|---|---|
| One-off export, quick check | Online converter |
| Data you do not want on a third-party server | Browser-based converter or local script |
| Scheduled or repeated exports | Python, PHP or Node script |
| Very large files (hundreds of MB) | Command-line tools such as jq |
| Non-developer teammate needs the file | Online converter, then share the CSV |
Related tools
Need Excel output directly? Use the JSON to Excel converter. Loading data into a database? The JSON to SQL converter generates the statements. Moving from JSON to XML? Try convert JSON to XML online. Browse everything in the AThemeArt tools library.
Standards worth knowing
JSON is defined in RFC 8259 and CSV conventions in RFC 4180. For a plain-language JSON primer, see MDN’s JSON guide. Tip: if accented characters look garbled in Excel, save the CSV as UTF-8 with BOM.
Frequently asked questions
How do I convert JSON to CSV?
Paste or upload your JSON, choose a delimiter, check the preview and download the CSV. Each object in the array becomes a row and each key becomes a column.
Can I convert nested JSON to CSV?
Yes. Nested objects are flattened into dotted column names, and arrays can be joined into one cell or spread across columns.
Is my data uploaded anywhere?
No. Conversion runs locally in your browser, so your JSON never leaves your device.
How do I convert JSON to CSV in Python?
Load the file with json.load, flatten it with pandas.json_normalize and write it with to_csv. For flat data, csv.DictWriter is enough.
Can I convert CSV back to JSON?
Yes. Switch to CSV to JSON mode, paste CSV with a header row, and you get an array of objects.
Why does my CSV look wrong in Excel?
Usually the delimiter or encoding. Try the semicolon delimiter and UTF-8 with BOM.
What happens if some records have different keys?
The header row is built from all keys found, and missing values are left blank.