JSON to CSV
Convert an array of JSON objects into clean CSV — locally.
JSON to CSV
How was your experience with this tool?
Found a bug? Missing a feature? Tell us — it takes 10 seconds.
See how it works
Watch a quick simulation of this tool in action — no file needed.
How to use JSON to CSV
Follow these steps — everything happens instantly in your browser.
- 1
Step 1. Paste a JSON array of objects into the input box (try the sample).
- 2
Step 2. Click Convert to CSV — keys are collected from every row in first-appearance order.
- 3
Step 3. Inspect the output, then Copy or Download as data.csv.
- 4
Step 4. Cells containing commas, quotes or newlines are wrapped and escaped automatically.
JSON to CSV: Why Nested Objects Need RFC 4180 Escaping to Survive
JSON and CSV model data fundamentally differently
JSON objects are self-describing and flexible — each object in an array can technically have different keys, nested structures, or missing fields, and the format doesn't require any of that to be declared upfront. CSV is the opposite: a strict grid, where every row must have the same number of columns aligned under one shared header row. Converting from one to the other means reconciling that flexibility against that rigidity, and every real decision this tool makes — how the header gets built, what happens to a missing field, how nested data gets represented — is really about resolving that structural mismatch.
Building the header from inconsistent objects
The tool doesn't require every object in your JSON array to share identical keys. Instead, it walks through every object in order and builds the header as the union of all keys encountered, in first-appearance order — meaning the first time a new key shows up in any row, it gets added to the header at that point, and it stays in that position for every subsequent row. If a later row doesn't have a given key, that row's corresponding CSV cell is simply left empty rather than causing an error or misaligning the columns.
This approach means you don't need to pre-normalize your JSON array so every object has identical keys before converting — the header naturally accommodates whatever fields actually appear across the full dataset.
Converting your data
Paste a JSON array of objects into the input box — or try the built-in sample to see the expected shape.
Click Convert to CSV — keys are collected from every row in first-appearance order to build the header.
Inspect the output, then Copy it or Download as data.csv.
Cells containing commas, quotes, or newlines are wrapped and escaped automatically — no manual cleanup needed.
Why quoting and escaping follow RFC 4180 specifically
| Situation | What happens | Why |
| --- | --- | --- |
| Cell contains a comma | Wrapped in double quotes | Prevents the comma from being read as a column separator |
| Cell contains a double quote | Quote is doubled ("") and the cell is wrapped in quotes | Distinguishes a literal quote character from the wrapping quotes |
| Cell contains a newline or carriage return | Wrapped in double quotes | Prevents the newline from being read as a new row |
| Cell has none of the above | Left unquoted | Keeps simple values clean and readable |
What actually happens to nested objects and arrays
CSV has no native concept of nested structure — every cell is fundamentally a flat string. When a JSON value in your array is itself an object or array rather than a simple string or number, this tool serializes it back into a JSON string and places that string inside the cell, quoting it if the serialized JSON happens to contain commas or quotes (which it very often will, since JSON syntax itself uses both). This is a deliberate choice to preserve the data rather than silently dropping it or flattening it lossily — the nested structure survives intact as text, and can be parsed back into an object later if needed, even though it won't display as separate spreadsheet columns.
Verifying your conversion looks right
Before relying on the output, check two things specifically: that the header row contains every field you expect (missing an expected column usually means that key never appeared in any row of your source JSON), and that any cell you know contains a comma, quote, or newline in the original data appears properly quoted in the output rather than accidentally breaking column alignment. Opening the downloaded CSV in a spreadsheet application is the fastest practical check — if columns look shifted or misaligned anywhere, that's usually a sign of unescaped special characters, though this tool's RFC 4180 handling should prevent that from happening in normal use.
Common mistakes
Assuming a top-level JSON object (rather than an array of objects) will convert — the required shape is specifically an array where each element is a plain object representing one row.
Expecting nested objects or arrays to expand into separate columns — they're preserved as serialized JSON strings within a single cell instead.
Manually pre-normalizing every object to have identical keys before converting — the tool already handles inconsistent key sets by building a union header and leaving missing fields blank.
Opening the CSV in software that doesn't correctly handle RFC 4180 quoting — most modern spreadsheet tools do, but older or custom CSV parsers occasionally don't handle embedded quotes and newlines correctly.
Real use cases
Exporting an API response's JSON array into a CSV file that non-technical colleagues can open directly in a spreadsheet.
Converting scraped or exported JSON data into a format compatible with tools that only accept CSV input.
Preparing JSON log data for analysis in spreadsheet software, preserving any nested fields as inspectable JSON text.
Quickly checking what a JSON dataset's actual field coverage looks like by seeing which columns appear in the generated header.
Frequently asked questions
Q: What JSON shape is required?
A: The top-level value must be an array of plain objects. Each object becomes a row, and the union of keys, in first-appearance order, becomes the header.
Q: How are special characters handled?
A: Any cell containing a comma, double quote, newline, or carriage return is wrapped in double quotes; embedded double quotes are escaped by doubling them (""), per RFC 4180.
Q: What happens to nested objects or arrays?
A: They're serialized as a JSON string within the cell, and quoted if that serialized string contains commas or quotes. This preserves the data so it can be parsed back later.
Q: Does it preserve key order?
A: Yes. The header is built by walking each row in order and adding any new keys encountered. If a row is missing a key, the corresponding cell is left empty.
Q: Is my data uploaded?
A: No. Parsing and CSV generation happen entirely in your browser, with zero network requests.
Q: Why does my CSV have more columns than I expected?
A: If different objects in your JSON array have different sets of keys, the header includes the union of all keys across every row — a field that only appears in one object out of a hundred still gets its own column, with empty cells for every row that lacks it.
Convert your JSON now
Try the JSON to CSV tool. Need to validate or pretty-print your JSON first? Use the JSON Formatter. Converting to a different structured format instead? Check the JSON ↔ YAML Converter, or extract specific fields with the Regex Tester.
Want the extended step-by-step tutorial? Read it here.
Why use this tool
Private by design
All processing happens locally in your browser. Open DevTools → Network and you'll see zero file uploads. Ever.
Instant
No upload wait, no queue, no server round-trip. Results appear the moment you drop a file.
Free & unlimited
No accounts, no watermarks, no daily caps. Use it as many times as you like, forever.
Works everywhere
Desktop, tablet or phone — every tool is responsive and installable as a PWA for offline use.
Frequently asked questions
Everything you might want to know about json to csv.
❤️ This tool is free — forever.
Sharing it helps more people discover it, and ad revenue from visitors is what keeps it free. No accounts, no catch.
JSON Formatter
Beautify, minify and validate JSON — 100% in your browser.
JSON ↔ YAML Converter
Convert JSON to YAML and YAML back to JSON — no libraries.
Base64 Encode / Decode
Convert text to and from Base64 — Unicode-safe, no uploads.
Regex Tester
Test JavaScript regex with live match highlighting & groups.