CalcFacts
Developer calculator

JSON to CSV Converter

Export JSON arrays as spreadsheet-ready CSV.

Interactive calculator

CSV output

Rows

2

Columns

3

Output size

60 chars

name,age,address.city
Alice,30,New York
Bob,25,San Francisco

Columns

name
column
age
column
address.city
column

Conversion runs entirely in your browser — nothing is uploaded. The input must be a JSON object or an array of objects. With “Flatten” enabled, nested objects become parent.child columns; with it disabled, nested values are written as compact JSON strings.

How to use the json to csv converter

The JSON to CSV converter turns an array of JSON objects into a comma-separated table you can open in any spreadsheet. It is the reverse of the more familiar CSV-to-JSON conversion, and just as common: an API returns JSON, a database export is JSON, or a config file holds structured data — but someone needs it in Excel or Google Sheets. Paste the JSON, get CSV, download it, and open it anywhere.

The converter runs entirely in your browser. Your data is never uploaded to a server, so it is safe for private records, unreleased data, and anything you would not paste into a public tool.

What the converter expects

The input should be a JSON object or, most commonly, an array of objects — the shape most APIs return. Each object becomes one row of the CSV. A single object is wrapped into a one-row table automatically. If you paste something that is not valid JSON, the tool tells you immediately so you can fix it before converting.

Flattening nested objects

Real JSON is often nested: an address object inside a user object, for example. CSV has no concept of nesting — every column is flat — so the converter handles this by flattening nested fields into dot-path columns. With flattening enabled, user.address.city becomes a column named user.address.city, and the value sits in the correct cell for each row.

You can turn flattening off if you prefer. In that mode nested values are written as compact JSON strings inside a single column, which keeps the column count low but makes the data harder to read in a spreadsheet. For most people flattening is the better default.

Columns across mixed records

When array items do not all share the same keys — common in loosely-structured data — the converter unions the headers across every record. If one object has a name field and another has an email field, both become columns, and rows with a missing value get an empty cell. This means no data is dropped, even when the input is uneven.

Values, arrays, and escaping

Strings are written as-is, numbers and booleans as their literal text, and null or missing values as empty cells. Arrays are serialized to compact JSON inside their cell (or expanded into indexed columns like tags.0, tags.1 when you enable array expansion). Any cell containing the delimiter, quotes, or a line break is automatically wrapped in quotes with proper escaping, so the output stays valid CSV no matter what your data contains.

Typical uses

Developers export API responses to CSV so a colleague can review them in Excel without touching code. Analysts convert JSON logs or event data into spreadsheets for pivot tables and charts. Anyone who receives JSON from a database or third-party service and needs a shareable, human-readable table will use this converter regularly.

Frequently asked questions

What JSON structure does this tool accept?

An array of objects is the standard input — each object becomes one row. A single object is wrapped into a one-row table automatically. Scalar values and nested arrays are handled, but the cleanest results come from an array of flat or lightly nested objects.

What does “flatten nested fields” mean?

CSV columns are flat, so nested objects are expanded into dot-path column names. For example, a field user.address.city becomes a column named user.address.city with each row’s value in that column. With flattening off, the nested value is stored as a compact JSON string in a single column.

How are records with different keys handled?

The converter unions the headers across all records. If one object has a field another lacks, that field still becomes a column, and rows missing it get an empty cell. No data is dropped, even when the array items are uneven.

How are arrays inside objects converted?

By default an array is serialized to a compact JSON string inside its cell. If you enable array expansion, simple arrays are spread into indexed columns like tags.0, tags.1, which is useful when you need to sort or filter by individual elements in a spreadsheet.

Is my data uploaded anywhere?

No. Conversion happens entirely in your browser. Your JSON is never transmitted or stored, making this tool safe for private and sensitive data.

Related calculators

View all

Why use CalcFacts?

  • Every calculation runs in your browser — nothing is uploaded.
  • No signup, no paywall, no email required.
  • Clear formulas and breakdowns you can verify yourself.
  • Built for speed: results update as you type.