JSON to CSV

Convert JSON arrays to CSV.

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Paste a JSON array of objects and get CSV back, with the keys of the first object as the header row. Values that contain commas or quotes are wrapped and escaped for you. Conversion runs in your browser.

How to use

1
Step 1
Paste a JSON array such as [{"id":1,"name":"Ada"}] into the input box.
2
Step 2
Press Run.
3
Step 3
Copy the CSV or download it, then open it in Excel, Google Sheets or a database import.

How it works

The tool parses the JSON, wraps a single object in an array if needed, and writes one CSV row per object using Papa Parse. The header row is taken from the keys of the first object, so keys that only appear in later objects are dropped. Cells containing commas, quotes or line breaks are quoted and inner quotes are doubled, as RFC 4180 expects.

Worked example

Two records to CSV

Input
[{"id":1,"name":"Ada","role":"admin"},{"id":2,"name":"Lin","role":"editor"}]
Output
id,name,role 1,Ada,admin 2,Lin,editor
Walkthrough
The keys id, name and role become the header, and each object becomes one row in key order.

Limitations

  • Columns come from the first object only. If a later object has an extra key, that value is lost; put the full set of keys in the first record.
  • Nested objects and arrays are not flattened. Each one is written into its cell as JSON text, so flatten the data first if you need separate columns.
  • An array of plain values such as [1,2] gives a single "value" column.
  • Invalid JSON stops with an error that points at the line and column.

Questions

How do I convert JSON to CSV?
Paste a JSON array of objects, press Run and copy the CSV. Each object becomes a row and the first object's keys become the header.
Why are some of my JSON keys missing from the CSV?
The header is built from the first object only. Keys that first appear in a later object are ignored, so make sure the first record has every key.
What happens to nested JSON objects?
They are not flattened. A nested object or array is written into its cell as JSON text, so flatten it before converting if you need separate columns.
Can I convert a single JSON object?
Yes. A single object is treated as an array with one item and produces a header row plus one data row.

Features

  • First-object header row
  • Quotes and commas escaped
  • Single object or array
  • Runs in your browser

Guides

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • SQL Tutorial - Full Database Course

    freeCodeCamp.org

    JSON often lands next to SQL exports when debugging data pipelines.

    Watch on YouTube
  • Learn JSON - Full Crash Course for Beginners

    freeCodeCamp.org

    Solid JSON syntax and nesting basics for formatter and validator tools.

    Watch on YouTube