Data Formats2026-06-20

How to Convert JSON to CSV (Free, Online, or with Python)

Convert JSON to CSV online, with Python, or in Excel. Learn how to flatten nested JSON into clean spreadsheet columns step by step.

jsoncsvdata-formatspythondeveloper-tools

How to Convert JSON to CSV (Free, Online, or with Python)

To convert JSON to CSV, map each JSON object to a row and each key to a column header. The fastest way is an online JSON-to-CSV converter; for nested data you flatten objects into dotted column names. In Python, pandas.json_normalize() handles complex structures cleanly.

JSON is hierarchical; CSV is a flat grid. The whole job is turning one into the other without losing data. Here's how.

JSON vs CSV Structure

JSON nests data; CSV is rows and columns:

[
  { "id": 1, "name": "Ada",  "city": "London" },
  { "id": 2, "name": "Alan", "city": "Bletchley" }
]

becomes:

id,name,city
1,Ada,London
2,Alan,Bletchley

Each object becomes a row; each key becomes a column. The conversion is clean when your JSON is a flat array of objects.

Method 1: Convert Online in One Click

The quickest route — no install, nothing leaves your browser. Paste your JSON into our JSON to CSV tool and copy or download the CSV. If you only want to view the data as a grid, JSON to Table renders it as sortable rows.

If the converter errors, your JSON may be invalid — check it first with the JSON Validator.

Method 2: Flatten Nested JSON

Real-world JSON often nests objects:

{ "id": 1, "name": "Ada", "address": { "city": "London", "zip": "EC1" } }

Flatten nested keys with dot notation so they become columns:

id,name,address.city,address.zip
1,Ada,London,EC1

Arrays inside objects are trickier — you either join them into one cell ("admin; editor") or expand them into multiple rows. Decide based on how you'll use the CSV.

Method 3: Convert with Python (pandas)

For large or deeply nested files, Python is ideal:

import pandas as pd
import json

with open("data.json") as f:
    data = json.load(f)

# Flattens nested JSON automatically
df = pd.json_normalize(data)
df.to_csv("output.csv", index=False)

json_normalize expands nested objects into dotted columns; pass record_path and meta to explode nested arrays.

Method 4: Open the CSV in Excel

Once you have the CSV, open it directly in Excel or Google Sheets. If you'd rather go straight to a spreadsheet, see How to Convert JSON to Excel.

Troubleshooting Irregular Keys

If objects have different keys, a good converter unions all keys into the header and leaves blanks where a record lacks a value. Validate and pretty-print messy input first with the JSON Formatter so you can see the structure before converting.

Frequently Asked Questions

How do I convert JSON to CSV? Map each JSON object to a row and each key to a column. Use an online JSON-to-CSV converter, or pandas.json_normalize() in Python.

How do I convert JSON to CSV in Python? Load the JSON, run pandas.json_normalize(data) to flatten it, then call df.to_csv("output.csv", index=False).

How do I handle nested JSON? Flatten nested keys into dotted column names (address.city), and either join or explode inner arrays depending on your needs.

Can Excel open JSON directly? Not as a table. Convert JSON to CSV first (or use Excel's Power Query), then open the result.

How do I convert a JSON array to CSV? A flat array of objects converts directly — each object is a row, each key a column. Paste it into a JSON-to-CSV tool.

Related Reading

The trick to JSON→CSV is deciding how to flatten nesting. Once your data is a flat array of objects, the conversion is instant — online or in a couple lines of Python.