Skip to content

Converter Tools

JSON to CSV

Flattens JSON objects into a table, using the object keys as column headers. Values are quoted properly and nested objects become dotted columns.

  • Free
  • No sign-up
  • Runs in your browser

Guide

Turning JSON objects into table rows

JSON is built for nested, flexible data, while CSV is a flat table with the same columns on every row. Converting means choosing columns and flattening each record into one line of values.

This tool expects an array of objects, such as a list of people each with a name, age and city. The keys become the header row, and each object becomes one line below it. A single object is also accepted and treated as an array with one row, and a plain list of values such as [1, 2, 3] becomes a single column called value.

The columns come from every key found across all objects, in the order they first appear. An object missing a key gets an empty cell in that column, which keeps the table rectangular even when the JSON is uneven.

Where JSON to CSV is the right move

Usually a person, rather than a program, needs to look at the data. An API response is easy for code but awkward in a spreadsheet. CSV opens directly in spreadsheet applications, so an analyst or client can sort, filter and chart it without technical setup.

It is also handy for importing records into systems that accept CSV, sharing a small data set by email, or checking at a glance whether objects share the same fields. Once you have the CSV, the CSV to Excel converter can turn it into a workbook, and the JSON validator can confirm your JSON is valid before you start.

How to convert JSON to CSV here

  1. Paste your JSON into the JSON box. A short sample array is already there.
  2. If the JSON has a syntax error, a red error message appears instead of the output. Fix it and the message clears.
  3. Pick the Separator (comma, semicolon, tab or pipe) and decide whether to flatten nested objects.
  4. Read the result in the CSV box, where the first line holds the headers, then click Copy or Download .csv.

Everything runs in your browser and nothing is uploaded.

How tricky values are handled

The converter follows the standard CSV rules so the table opens correctly:

  • Quoting: a value containing the separator, a quote mark, a line break, or spaces at either end is wrapped in double quotes, and quote marks inside are doubled.
  • Nested objects are flattened into dotted columns such as address.city when the flatten option is on (the default). With it off, the whole object is written into one cell as JSON text.
  • Arrays inside a record are written into a single cell as JSON text, for example ["a","b"], so no extra columns appear.
  • null and missing values become empty cells.
  • Numbers and booleans are written as plain text such as 32 or true.

It works best for lists of records. For deeply nested data, check the result in a spreadsheet. The reverse direction is CSV to JSON.

Frequently asked questions

What shape of JSON does it need?

An array of objects works best, with each object as a row. A single object gives one data row, and a list of plain values becomes one column named value.

What if my objects have different keys?

The headers are the union of all keys. Objects missing a key get an empty cell in that column.

What happens to nested objects and arrays?

Nested objects become dotted columns like address.city (you can turn this off). Arrays stay in one cell as JSON text so the row keeps its columns.

Will commas and quotes in my values break the table?

No. Values with commas, quotes or line breaks are wrapped in quotes and escaped, so spreadsheets read them as one cell.