Data tool

JSON to CSV Converter

Paste an array of objects and get CSV with one column for each key.

Runs in your browser. No upload.

Use an array of JSON objects with a shared set of keys.

About this tool

JSON to CSV Converter made simple.

Nested values are kept as JSON text and every value is escaped for spreadsheet-friendly CSV output.

Guide

Using JSON to CSV Converter

JSON to CSV Converter turns an array of JSON objects into comma-separated text with one column for each key. Values with commas, quotes or line breaks are quoted for spreadsheets, and nested values are kept as JSON text. It does not split nested data into columns or save a file for you.

How to use it

  1. Paste a JSON array of objects into the top box, for example an array holding one object with a name and an age.
  2. Press Convert to CSV. The first row holds the column names and each object becomes one row. A line under the buttons says how many rows were converted.
  3. Press Copy result and paste the text into a spreadsheet or a .csv file. Use Clear to start again.

Worked examples

Two simple records

You enter
Json
[{"name":"Ada","age":36},{"name":"Alan","age":41}]
You get
Csv
name,age Ada,36 Alan,41

The keys of the first object give the header row, and each object adds one line of values in the same order.

Run through the tool’s own code.

Objects with different keys

You enter
Json
[{"name":"Ada","city":"London"},{"name":"Grace","role":"Admiral"}]
You get
Csv
name,city,role Ada,London, Grace,,Admiral

The columns are every key found anywhere, in the order they first appear. A key an object does not have becomes an empty cell.

Run through the tool’s own code.

Commas, quotes and nested values

You enter
Json
[{"name":"Smith, Jo","note":"said \"hi\"","tags":["a","b"]}]
You get
Csv
name,note,tags "Smith, Jo","said ""hi""","[""a"",""b""]"

A cell with a comma, a quote or a line break is wrapped in quotes and inner quotes are doubled. The list in tags is written as JSON text in a single cell.

Run through the tool’s own code.

A single object is refused

You enter
Json
{"name":"Ada"}
You get
Message
Use a non-empty array of JSON objects.

Only a non-empty array whose items are all plain objects is accepted. Wrap a single object in square brackets to convert it.

Run through the tool’s own code.

When it helps

  • Move API output into a spreadsheet so you can sort and filter it.
  • Turn a short list of records from a script into text that someone else can open in Excel or Sheets.
  • Look at the header row to see which keys appear across a set of objects.

Limits to keep in mind

  • The input must be a non-empty array in which every item is a plain object. A single object, an array of numbers or an array that contains arrays is refused.
  • Nested objects and arrays are not split into columns. Each is written as JSON text inside one quoted cell.
  • Whole numbers above 9,007,199,254,740,991 keep all their digits, but other numbers go through the browser's JSON parser, so 1.50 is written as 1.5. Lines are separated by a plain line feed, and the page only offers Copy result, with no download button.

Tips

  • Put long IDs or phone numbers in the JSON as strings so that every digit is kept. Your spreadsheet may still reformat them when it opens the text.
  • Columns follow the order in which keys first appear, so put the columns you want first into the first object.
  • Check the header row for typos, because a misspelled key in one object creates an extra column.

Sources

Common questions

About JSON to CSV Converter.

How do I convert JSON to CSV?

Paste an array of objects, press Convert to CSV and copy the result. The header row lists the keys, and each object turns into one row of values separated by commas.

What happens if the objects have different keys?

The tool takes every key from every object, in the order first seen, and uses them all as columns. Where an object lacks a key, that cell is left empty.

How are nested objects and arrays handled?

They are not flattened. A nested object or array is written as JSON text and placed in one quoted cell, so you can still read it or split it later in a spreadsheet or script.

How are null, true and false written?

A null value and a missing key both give an empty cell. The values true and false are written as the words true and false, and strings are written as they are, with quotes added only when needed.

Why might accents look wrong in my spreadsheet?

The text has no byte-order mark, so some spreadsheet programs may guess the wrong encoding when they open a saved file. Import it as UTF-8, or paste the copied text straight into a sheet.

Is my data uploaded?

No. The conversion runs in your browser and the text is not sent anywhere. Do not paste private data on a shared computer, because it stays in the page until you press Clear.

What JSON format can I convert to CSV?

Use an array of JSON objects. The object keys become column names and each object becomes a row.

How are commas and quotes handled in CSV output?

CSV values are escaped so commas, quotes and line breaks remain inside their cells.