All articles

How to Convert JSON to CSV

Three practical ways to turn JSON into a spreadsheet-ready table — plus how to handle nested data.

September 14, 2026 CheBit

JSON (JavaScript Object Notation) is how modern APIs and apps exchange data. CSV (comma-separated values) is how spreadsheets and databases store tables. When you pull data out of an API and need to open it in Excel, run a report, or import it into a database, you usually need to convert one into the other.

This guide walks through three ways to do it — starting with the fastest, no-install method — and covers the gotchas that trip people up, like nested objects and delimiter choice.

Why convert JSON to CSV?

JSON is great for machines, but it's awkward for humans and for spreadsheet software. A raw API response looks like nested brackets and quotes; a CSV looks like a clean grid. Converting to CSV lets you:

  • Open data in Excel, Google Sheets, or Numbers for sorting, filtering, and charting.
  • Import into a database — most SQL tools accept CSV far more readily than raw JSON.
  • Share a flat, readable table with non-technical colleagues who don't work in JSON.

Method 1: Use a free JSON to CSV converter (fastest)

For one-off conversions, a browser-based converter is the quickest option. Nothing to install, and the good ones process everything locally so your data never leaves your device. Here's how to do it with our free JSON to CSV Converter:

  • 1.Paste your JSON into the input box. It can be a single object, an array of objects, or nested data.
  • 2.Pick a delimiter — comma, semicolon, tab, or pipe — from the dropdown.
  • 3.Click Convert, then copy the output or click Download CSV to save the file.

Before converting, it's worth confirming your JSON is valid. If you get an error, paste it through our JSON Formatter first — it'll point you at the exact line with the syntax problem. For a full walkthrough, see How to Format and Validate JSON.

Method 2: Import into a spreadsheet

If you'd rather stay inside Excel or Google Sheets, both can pull in JSON — with a little coaxing.

In Microsoft Excel

Excel's Power Query understands JSON natively. Go to Data → Get Data → From File → From JSON (or From Web and paste an API URL). Power Query expands the JSON into rows and columns, and you can choose which nested fields to keep. Once it looks right, load it into a worksheet and save as CSV.

In Google Sheets

Google Sheets doesn't have a built-in JSON importer, but a one-line formula works for simple cases. If your JSON is in cell A1, this extracts a single field:

=IMPORTDATA("https://api.example.com/data.json")

For nested JSON, the cleanest route is usually to convert it to CSV first (Method 1), then import the resulting file — spreadsheets handle flat CSV far more reliably than arbitrary JSON.

Method 3: Write a short script

If you convert JSON regularly — or the data is sensitive and must never touch a third-party server — a small script gives you full control. Here's a Python one-liner for an array of flat objects:

python -c "import pandas as pd; pd.read_json('data.json').to_csv('data.csv', index=False)"

Without pandas, the standard library does the job in a few lines:

import json, csv

with open("data.json") as f:
    rows = json.load(f)            # a list of flat dicts
with open("data.csv", "w", newline="") as f:
    writer = csv.DictWriter(f, fieldnames=rows[0].keys())
    writer.writeheader()
    writer.writerows(rows)

This approach is perfect for automation — drop it into a cron job or a data pipeline, and it runs with no browser and no network call.

Handling nested JSON

The tricky cases are arrays and objects nested inside your records. A CSV is a flat grid, so nested data has to be flattened somehow. Most converters handle it like this:

  • Nested objects get turned into a JSON string and placed in a single cell — so {"city": "Tokyo"} becomes the cell text {"city":"Tokyo"}.
  • Nested arrays are either collapsed into a comma-separated value, or expanded so each item gets its own column.
  • Mixed keys across records are merged — if one object has an extra field, it becomes a new column with empty cells everywhere else.

If your data is deeply nested and you need a specific shape, the script method gives you the most control over exactly which fields become columns.

Choosing the right delimiter

CSV technically means "comma-separated," but not every dataset is comma-friendly. A few rules of thumb:

  • Comma (,) — the default for English-language locales and most general use.
  • Semicolon (;) — common in Europe, where a comma is the decimal separator and can't double as a field separator.
  • Tab — convenient for pasting straight into a spreadsheet without a formal import.
  • Pipe (|) — handy when your data itself contains commas or semicolons.

Whichever you pick, just make sure the field values don't contain the same character — a good converter will quote values that include the delimiter automatically.

Frequently asked questions

Can you convert nested JSON to CSV?

Yes. Most converters flatten nested objects and arrays into a single row per record. Nested objects are typically stringified into a single cell, and nested arrays are either expanded into extra columns or collapsed into a comma-separated value.

What CSV delimiter should I use?

Use a comma for English-language locales and general use. Choose a semicolon if your spreadsheet uses European number formats, a tab for pasting into spreadsheets, or a pipe when your data contains commas.

Does converting JSON to CSV lose data?

CSV is a flat table format, so it can't preserve deeply nested structure or data types the way JSON can. Values that don't fit a table cell are usually stringified. For flat, tabular data the conversion is lossless.

Ready to convert JSON to CSV?

Paste your JSON and download a clean CSV in seconds with the free JSON to CSV Converter — no signup, runs entirely in your browser.

Convert JSON to CSV