PrettyJSON Logo
PrettyJSON

Instantly clean, validate, and inspect web payloads

JSON Input
CSV Output

Waiting for JSON input

Paste JSON on the left or load the sample to see CSV instantly.

100% Client-Side & Private

Convert JSON to CSV Online

Turn a JSON array of objects into a spreadsheet-ready CSV in one step. PrettyJSON walks every object, flattens nested objects and arrays into dot-notation columns, and builds the header from the union of keys across all rows — so records with different shapes still line up. Fields are quoted per the RFC 4180 rules Excel and Google Sheets expect, and the whole thing runs in your browser, which matters when the payload is a production API dump.

Loads into SQL and BI tools

The flat output drops into a Postgres COPY, a BigQuery load job, or a spreadsheet pivot without reshaping it first.

Deterministic columns

Headers are the union of every key in first-seen order, so the same input always produces the same columns and a clean git diff.

Ragged records still align

Objects with missing or extra fields line up correctly — an absent key leaves an empty cell instead of shifting the row.

How to convert JSON to CSV

A quick walkthrough and the details that matter.

Steps

  1. Paste a JSON array of objects, or upload a .json file (a single object is treated as one row).
  2. PrettyJSON flattens nested structures and derives the column headers automatically.
  3. Review the CSV on the right, then copy it or download a .csv for Excel, Sheets, or pandas.

How nested objects and arrays become columns

CSV is flat and JSON is not, so depth is flattened into dot-notation headers. An object such as {"address":{"city":"London"}} becomes a single address.city column, and an array such as "skills":["c","git"] becomes skills.0 and skills.1. Every scalar stays addressable in one row without inventing a nesting convention a spreadsheet cannot read; deeply nested payloads simply produce longer column names.

Rows with different keys stay aligned

Real-world JSON is full of optional fields. PrettyJSON scans every object first and builds the header from the union of all keys in first-seen order. When a row is missing a key, that cell is left empty instead of shifting the columns — so a large export with a few sparse fields still lines up correctly when you open it.

Example: JSON in, CSV out

A before-and-after using sample JSON.

JSON input
[
  { "id": 1, "name": "Ada", "address": { "city": "London" } },
  { "id": 2, "name": "Linus", "skills": ["c", "git"] }
]
CSV output
id,name,address.city,skills.0,skills.1
1,Ada,London,,
2,Linus,,c,git

Frequently Asked Questions

Common questions about converting JSON to CSV.

What JSON shape converts best to CSV?

An array of flat or shallow objects — that is the natural table shape. A single object is exported as a one-row CSV, and an array of primitives like [1, 2, 3] becomes a single-column file.

Why are some cells blank in the output?

The header is the union of every key seen across all objects. If a particular object does not include one of those keys, its cell is left empty so the columns stay aligned across every row.

Will commas or quotes inside a value break the columns?

No. Values that contain commas, double quotes, or line breaks are wrapped in double quotes with internal quotes doubled, following RFC 4180 — the same convention Excel, Google Sheets, and pandas read.

Can I convert sensitive production data safely?

Yes. Parsing and CSV generation happen in your browser tab with no upload, network request, or logging, so an API dump containing customer records never leaves your machine.