"category": "format-converter",

JSON to CSV Converter

"tldr": Paste a JSON array of objects on the left and get a spreadsheet-ready CSV with headers on the right - free, instant, and entirely in your browser.

Convert a JSON array of objects into a CSV file you can open in Excel, Google Sheets, or any data tool. Paste your JSON on the left and the CSV appears instantly - headers are derived from your object keys, values with commas or quotes are escaped correctly, and nested objects are serialized so no data is lost.

{"json": "csv"}

Everything runs locally in your browser. Your data is never uploaded to a server, which makes this tool safe for API responses, exports containing customer records, or anything else you would not paste into a random website.

How to convert JSON to CSV

  1. 1Paste your JSON into the input panel, or click "Load sample" to see the expected shape.
  2. 2The converter reads every object in the array and builds the union of all keys as CSV headers.
  3. 3Review the CSV output - fields containing commas, quotes, or line breaks are quoted automatically.
  4. 4Copy the result or download it as a .csv file ready for Excel or Google Sheets.

Convert JSON to CSV in code

Python
import csv, json

with open("data.json") as f:
    rows = json.load(f)

with open("data.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=rows[0].keys())
    writer.writeheader()
    writer.writerows(rows)
JavaScript
const rows = JSON.parse(jsonString);
const headers = Object.keys(rows[0]);
const csv = [
  headers.join(","),
  ...rows.map(r => headers.map(h => JSON.stringify(r[h] ?? "")).join(","))
].join("\n");

Frequently asked questions

What JSON structure do I need for CSV conversion?

CSV is tabular, so the ideal input is an array of flat objects where each object is one row, like [{"name": "Ada", "age": 36}]. A single object also works and produces one row. If your objects have different keys, the converter uses the union of all keys and leaves missing values empty.

How are nested objects and arrays handled?

Nested values cannot be represented natively in CSV, so they are serialized as JSON strings inside the cell. If you need nested fields as separate columns, flatten the JSON first - for example turn {"user": {"name": "Ada"}} into {"user_name": "Ada"}.

Will this work with large JSON files?

Yes. Because conversion happens in your browser rather than on a server, the practical limit is your device memory. Files with hundreds of thousands of rows typically convert in a few seconds.

Is my data uploaded anywhere?

No. The conversion is pure JavaScript running on your machine. Nothing is transmitted, logged, or stored, so it is safe for sensitive exports.

Last updated:

You might also need

Free and in-browser, like everything on JSON Console. Browse all tools →