How to Convert JSON to CSV Online

JSON is the standard format for web APIs. CSV is the standard format for spreadsheets, data analysis, and database imports. If you work with both, you will eventually need to move data between them. This guide explains how to convert JSON to CSV online, which JSON structures work well, and what to do when they don't.

What JSON structure converts to CSV?

CSV is a flat, two-dimensional format: rows and columns. Not all JSON structures map cleanly to this format. The structure that works best is an array of objects where every object has the same keys:

[
  { "id": 1, "name": "Alice", "role": "admin", "active": true },
  { "id": 2, "name": "Bob",   "role": "editor", "active": true },
  { "id": 3, "name": "Carol", "role": "viewer", "active": false }
]

This converts to a CSV table directly: the keys become column headers, and each object becomes a row:

id,name,role,active
1,Alice,admin,true
2,Bob,editor,true
3,Carol,viewer,false

If your JSON is an object (not an array), or an array of non-uniform objects, you will need to restructure it first.

How to convert JSON to CSV in 3 steps

  1. Validate your JSON — Paste it into a validator to confirm there are no syntax errors. A converter that receives invalid JSON will either fail silently or produce garbled output.
  2. Paste into the converter — Open the JSON to CSV converter, paste your JSON array into the input box, and click Convert.
  3. Download the CSV — Copy the output or download it as a .csv file. Open it directly in Excel or Google Sheets.

Handling nested JSON objects

When an object contains nested objects or arrays, the converter has to decide what to do with them. There are two common approaches:

Dot notation flattening — Nested keys are joined with a dot:

// Input
[{ "user": { "name": "Alice", "age": 28 }, "active": true }]

// CSV output with flattening
user.name,user.age,active
Alice,28,true

Serialization — The nested object is converted to a JSON string and placed in a single cell:

user,active
"{""name"":""Alice"",""age"":28}",true

Flattening is more useful if you intend to work with the data in a spreadsheet. Serialization preserves the full nested structure but results in cells that require further parsing.

Common problems and how to fix them

The JSON is wrapped in an outer object

Many APIs return JSON like {"data": [...], "meta": {...}}. The array you want is nested inside a property. Extract the array first before converting:

// Full API response
{
  "data": [
    { "id": 1, "name": "Alice" },
    { "id": 2, "name": "Bob" }
  ],
  "meta": { "total": 2 }
}

// Use only this part for CSV conversion
[
  { "id": 1, "name": "Alice" },
  { "id": 2, "name": "Bob" }
]

Objects have inconsistent keys

If different objects in the array have different keys, the CSV will have empty cells for missing values. Most converters handle this by using all unique keys as headers and leaving blank for any object that lacks a given key. This is usually fine for analysis but worth checking in your output.

Values contain commas

If a string value contains a comma, the CSV converter should wrap it in double quotes automatically. If values contain double quotes, those quotes need to be escaped by doubling them: ""like this"". A well-built converter handles this; a basic one may not.

Importing into Excel and Google Sheets

FAQ

What JSON structure can be converted to CSV?

An array of objects where each object has the same keys works best. Each object becomes a row and each key becomes a column header.

What happens to nested objects in JSON to CSV conversion?

Nested objects are typically flattened using dot notation or serialized as a JSON string in a single cell, depending on the converter.

Can I import the CSV into Excel or Google Sheets?

Yes. Save the CSV with a .csv extension and open it directly in Excel, or use File → Import in Google Sheets.

Convert JSON to CSV instantly

Paste a JSON array and download a ready-to-use CSV file for Excel, Google Sheets, or any data tool. Free, private, no signup required.

Open JSON to CSV Converter