Developer7 min readUpdated 2026-06-26

How to Convert JSON to CSV

Tools mentioned in this guide

JSON is how applications and APIs pass data around. CSV is how spreadsheets, finance teams, and data tools want to receive it. So the moment you need to open API output in Excel, hand a dataset to someone non-technical, or load records into a tool that only accepts spreadsheets, you need to turn that JSON into CSV — and doing it by hand is miserable.

This guide shows the fastest way to convert JSON to CSV, what to do when your data is nested rather than flat, and how to open the result cleanly in Excel or Google Sheets. If you just want it done now, paste your JSON into the free JSON to CSV converter — it runs entirely in your browser, so your data is never uploaded to a server.

What JSON converts cleanly into CSV

CSV is a flat, two-dimensional format: rows and columns, nothing more. JSON is hierarchical and can nest data many levels deep. The conversion works best when your JSON already looks like a table — specifically, an array of objects where every object has the same keys. Each object becomes a row; each key becomes a column.

This is the ideal shape:

[
  { "id": 1, "name": "Ada Lovelace", "role": "Engineer" },
  { "id": 2, "name": "Alan Turing", "role": "Mathematician" }
]

Which converts to:

id,name,role
1,Ada Lovelace,Engineer
2,Alan Turing,Mathematician

A single JSON object (not wrapped in an array) also works — the converter treats it as a one-row table. Anything more complex than this needs a quick flattening step first, covered below.

How to convert JSON to CSV (step by step)

  1. Open the JSON to CSV converter.
  2. Paste your JSON into the left panel, or click Upload File to load a .json file from your computer.
  3. The CSV appears in the right panel instantly as you type or paste — there is no "convert" button to press.
  4. If your JSON is malformed, you'll see a clear "Invalid JSON input" message instead of output. Fix the syntax (a missing comma or bracket is the usual culprit) and it re-converts automatically.
  5. Click Copy to grab the CSV, or Download to save it as converted.csv.

The conversion happens in your browser using a battle-tested CSV library that handles the fiddly parts for you — quoting values that contain commas, escaping quotation marks, and preserving line breaks inside fields. You don't have to think about any of it.

Dealing with nested JSON

Here's the honest catch most converters won't tell you: CSV has no concept of nesting. If a value in your JSON is itself an object or an array, it can't expand into neat columns automatically — there's nowhere for the sub-structure to go in a flat grid.

For example, this nested record:

[
  {
    "id": 1,
    "name": "Ada Lovelace",
    "address": { "city": "London", "country": "UK" }
  }
]

The top-level fields (id, name) convert fine, but the nested address object won't break into separate city and country columns on its own. To get clean output, flatten the JSON first so every value is a simple string, number, or boolean:

[
  {
    "id": 1,
    "name": "Ada Lovelace",
    "address_city": "London",
    "address_country": "UK"
  }
]

The simplest way to flatten is to pull only the fields you actually need into a flat array before converting — most code that produces JSON can .map() each record into a flat object in a couple of lines. Run that JSON through the converter and every column lands cleanly.

Make sure every object has the same keys

Columns are determined from the keys of the first object in your array. If later objects introduce keys the first one didn't have, those extra columns can be left out; if an object is missing a key, that cell is simply left blank. For predictable output, give every object the same set of keys — even if some values are empty strings or null.

Quick checklist before converting:

  • Top-level structure is an array [ ... ] (or a single object).
  • Every object has the same keys, in the same order ideally.
  • All values are flat — strings, numbers, booleans, or null. No nested objects or arrays.
  • The JSON is valid — run it through the JSON Formatter first if you're unsure; it will pinpoint syntax errors.

Open your CSV in Excel or Google Sheets

Once you've downloaded converted.csv:

  • Google Sheets: File → Import → Upload → choose the CSV → "Replace spreadsheet" or "Insert new sheet." Sheets detects the columns automatically.
  • Excel: Double-clicking usually works, but for reliable column splitting use Data → From Text/CSV → select the file → confirm the delimiter is a comma → Load.
  • Encoding tip: the converter outputs UTF-8. If accented characters or symbols look garbled in Excel, use the Data → From Text/CSV import path and set the file origin to UTF-8 rather than double-clicking.

Why convert JSON to CSV in your browser

API responses and exported data often contain things you don't want sitting on a stranger's server — customer records, emails, internal IDs, financials. Many online converters upload your file to do the work, which means your data leaves your machine.

FileNaut's JSON to CSV converter does the conversion 100% in your browser. Nothing is uploaded, logged, or stored — you can disconnect from the internet after the page loads and it still works. Need the round trip? The CSV to JSON converter goes the other way, and the JSON Formatter cleans up and validates messy JSON before you convert. All three are free and run locally.

Frequently Asked Questions

How do I convert JSON to CSV for free?
Paste your JSON (or upload a .json file) into the free JSON to CSV converter and the CSV appears instantly in the second panel. Click Copy or Download to save it as a .csv file. There's no signup, no watermark, and the conversion runs entirely in your browser.
What format does my JSON need to be in?
An array of objects works best — each object becomes a row and each key becomes a column. A single object also converts (as one row). For clean columns, every object should share the same keys and all values should be flat (strings, numbers, booleans), not nested objects or arrays.
Can it handle nested JSON?
CSV is a flat format, so nested objects and arrays can't expand into separate columns on their own. Top-level fields convert fine, but you should flatten nested values first — for example, turn address.city into a single address_city field — so each value is a simple string or number. Then the conversion is clean.
Can I open the CSV in Excel?
Yes. Download the CSV and open it in Excel or import it via Data → From Text/CSV for reliable column splitting. The output is UTF-8, so if special characters look wrong, use the import path and set the file origin to UTF-8 rather than double-clicking the file.
Is my data uploaded anywhere?
No. The JSON to CSV converter runs entirely in your browser — your data is never sent to a server, logged, or stored. You can confirm it by turning off your internet connection after the page loads; the converter still works because nothing is being transmitted. That makes it safe for sensitive API output and customer data.
Why is my CSV showing "[object Object]" in a cell?
That means the value in that field is a nested object or array, which a flat CSV can't represent. Flatten that part of your JSON first — pull the inner values out into their own top-level keys (for example user_name instead of a nested user object) — then re-convert and the cell will hold a real value.
What if I get an "Invalid JSON" error?
It means the text isn't valid JSON — usually a missing comma, an unclosed bracket, or trailing commas that JSON doesn't allow. Paste your data into the JSON Formatter first; it will highlight exactly where the syntax breaks. Once the JSON is valid, the converter produces CSV automatically.

Ready to try it?

Use the tool right now — free, no signup, no upload.