{}JSON FYI
Convert

JSON to CSV converter

Turn JSON arrays into CSV that opens cleanly in Excel, Google Sheets, or pandas. Choose a delimiter, include or skip the header row, and flatten nested objects into dotted columns.

Ready when you are.

Paste JSON on the left, or click Sample to try a quick example. The CSV output appears here as you type — entirely in your browser.

EmptyInput: 0 BOutput: 0 B

Why convert JSON to CSV?

JSON is great for APIs but awkward for spreadsheets. Most analytics tools, BI dashboards, and data-import workflows expect a tabular CSV. A converter gets you from one to the other without writing a script.

JSON FYI's converter follows RFC 4180: fields containing the delimiter, double quotes, or newlines are quoted and embedded quotes are doubled. The output works in Excel, Numbers, Google Sheets, LibreOffice Calc, pandas read_csv, R read.csv, and any tool that reads standard CSV.

For deeply nested objects, toggle Flatten nested — keys collapse to dotted paths like address.city and address.zip so each leaf gets its own column. Arrays inside cells are JSON-encoded so they round-trip back to JSON if needed.

Examples

Array of objects → tabular CSV
Input
[
  { "id": 1, "name": "Ada", "role": "engineer" },
  { "id": 2, "name": "Linus", "role": "kernel" }
]
Output
id,name,role
1,Ada,engineer
2,Linus,kernel

Headers come from the union of keys across all objects — order is first-seen.

Flatten nested objects
Input
[
  { "id": 1, "addr": { "city": "Berlin", "zip": "10115" } }
]
Output
id,addr.city,addr.zip
1,Berlin,10115

Toggle Flatten nested to expand object branches into dotted columns.

Quoting per RFC 4180
Input
[
  { "id": 1, "note": "hello, world" },
  { "id": 2, "note": "she said \"hi\"" }
]
Output
id,note
1,"hello, world"
2,"she said ""hi"""

Values with commas or quotes are wrapped; embedded quotes are doubled.

Use cases

Frequently asked questions

What JSON shape does the converter expect?+

An array of objects (each object becomes a row) is the most common — columns are derived from the union of keys. Arrays of arrays produce headerless rows. A single object becomes a one-row table. Top-level primitives can't be represented as CSV.

How are nested objects handled?+

By default they're embedded as JSON strings inside the cell. Toggle Flatten nested to expand them into dotted-path columns (e.g. address.city, address.zip).

What about commas, quotes, and newlines inside values?+

Anything containing the delimiter, a double quote, or a newline is wrapped in quotes and embedded quotes are doubled — per RFC 4180. Excel, Google Sheets, and pandas all read this correctly.

Which delimiter should I pick?+

Comma is the universal default. Use semicolon for European locales (where comma is the decimal separator), or tab for true TSV. Pipe is rare but handy when your data contains both commas and semicolons.

Is my JSON uploaded?+

No. The converter runs 100% in your browser — your data never leaves your device.

Will Excel recognize my CSV?+

Yes. Save with .csv, double-click to open, and Excel parses it. For non-ASCII characters use the Download button (the file is UTF-8) and choose 'UTF-8' if Excel prompts for an encoding.

Convert JSON to CSV in code

JavaScript, Python, Go, and Ruby snippets — copy and paste into your project.

Convert an array of objects to CSV

Read input.json (an array of objects), derive headers from the union of keys, and write output.csv.

node to-csv.js
import { readFileSync, writeFileSync } from "node:fs";

const data = JSON.parse(readFileSync("input.json", "utf8"));
const headers = [...new Set(data.flatMap(Object.keys))];
const quote = (v) => {
  if (v == null) return "";
  const s = typeof v === "object" ? JSON.stringify(v) : String(v);
  return /[",\n]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
};
const rows = data.map((r) => headers.map((h) => quote(r[h])).join(","));
writeFileSync("output.csv", [headers.join(","), ...rows].join("\n"));
Input
[
  { "id": 1, "name": "Ada", "role": "engineer" },
  { "id": 2, "name": "Linus", "role": "kernel" }
]
Output
id,name,role
1,Ada,engineer
2,Linus,kernel

Other JSON tools on JSON FYI

Every flow you need — formatter, validator, viewer, pretty print, repair, and the full workbench.

Related tools & guides