Skip to content
cliplimeClipLime

Convert JSON to CSV

Paste JSON or drop a file and get a CSV your spreadsheet opens, with nested data spread into columns.

Runs on your device, nothing is uploaded

Convert from

to

Paste, type, drop a file here or load one.

0 characters, 0 lines

Options

When off, columns are called column1, column2 and so on.

Nested objects become columns such as address.city. Off keeps them as JSON text in one cell.

More options

A path such as data.items. Use a single dot to turn the whole value into one row.

The dot in address.city.

Helps Excel show accents and symbols correctly.

Puts an apostrophe before text that starts with = + - or @.

At a glance

Input
JSON text or a .json file: a list of objects, an API response with a list inside, a list of lists, or a single object.
Nested objects
Spread into columns named by path, such as address.city.
Lists
Separate columns (tags.0, tags.1), one joined cell, or JSON text in one cell. You choose.
Different keys
The columns are the union of all keys, with empty cells where a record lacks one.
Output
A comma, semicolon, tab or pipe delimiter, correct quoting, and optional quotes around every value.
Spreadsheets
Optional byte order mark for Excel accents, and optional protection against text that starts with = + - or @.
Privacy
Your JSON is converted in your browser tab and never uploaded.

How to do it

  1. 1

    Paste or load your JSON

    Paste it, drop a .json file on the input box, or press Load a file. If the JSON has a problem, its line and column are shown with an explanation.

  2. 2

    Check which part becomes the rows

    A list at the top is the rows. For an API response, the converter uses the list it finds and names the keys it left out. Type a path under More options to choose another part.

  3. 3

    Choose how nested data is written

    Keep Flatten nested values into columns on for dotted columns, pick how lists are written, and set the delimiter your spreadsheet expects.

  4. 4

    Copy or download

    Copy the CSV or download a .csv file. For Excel with accents, turn on the byte order mark under More options.

What happens to nested objects and lists

A CSV cell holds one value, so nested data has to be spread out. Each nested object becomes columns named by their path: {"id": 1, "address": {"city": "Lisbon"}, "tags": ["a", "b"]} gives the columns id, address.city, tags.0 and tags.1.

  • Separate columns keeps every list item in its own cell. It is the only choice that converts back to the same JSON.
  • Joined into one cell writes a;b, which is easier to read when lists are short and made of plain values. Lists that contain objects are written as JSON text instead.
  • JSON text in one cell keeps the whole list exactly, as ["a","b"].
  • Turning Flatten nested values into columns off keeps every nested object and list as JSON text, so you get one column per top-level key.

An empty list or object is written as the text [] or {}, and is turned back into an empty list or object when you convert the CSV to JSON again.

Records with different keys

JSON records do not have to share keys. The converter reads all of them and uses the union of their keys as the columns, in the order the keys first appear. A record that lacks a key gets an empty cell, and a null value is written as an empty cell too. Booleans are written as true and false, and numbers in their shortest form.

That means a few columns near the end are often mostly empty when only some records have an extra key. That is correct, not a fault. If you do not want a column, remove it in your spreadsheet.

What spreadsheets expect from a CSV

Excel and Google Sheets open CSV files, but they apply their own rules when they do:

  • Delimiter: Excel uses the list separator from the computer's regional settings, which is a semicolon in many European countries. If everything lands in one column, choose a semicolon under Delimiter in the output.
  • Accents: Excel for Windows often reads a CSV as ANSI unless the file starts with a byte order mark. Turn on Add a byte order mark under More options.
  • Leading zeros and long numbers: Excel turns 00123 into 123 and shows numbers with more than 15 digits in scientific notation, rounding them. To keep such values, convert to an Excel file with the Data Converter instead of CSV.
  • Formulas: text that starts with = + - or @ can be run as a formula when the file is opened. Turn on Protect against spreadsheet formulas if the data comes from people you do not know.

Which part of your JSON becomes the rows

A list at the top level gives the rows, and a list of lists is read as a grid with the first list as the column names. An object that holds a list of objects uses that list, or the longest one if there are several, including lists inside wrappers such as data or results. The other top-level keys, such as status or count, are left out, and a note names them.

A plain object becomes one row. To choose another part, type its path under Rows come from, for example data.items, or a single dot to turn the whole value into one row. The same rules apply to YAML and XML in the Data Converter.

Questions people ask

How do I convert nested JSON to CSV?

Paste it in and keep Flatten nested values into columns on. Nested objects become columns named by their path, such as address.city, and lists become tags.0, tags.1 and so on. You can instead join lists into one cell or keep them as JSON text.

What if the objects in my list have different keys?

The columns are the union of all the keys, in the order they first appear. A record that lacks a key gets an empty cell for it.

Why does Excel show strange characters or put everything in one column?

Strange characters mean Excel did not read the file as UTF-8, so turn on the byte order mark under More options. Everything in one column means the delimiter does not match your regional settings, so choose a semicolon under Delimiter in the output.

My JSON is an object with a list inside. Which part becomes the rows?

The list of objects, including one inside a wrapper such as data or results. The converter says which list it used and which top-level keys it left out. Use Rows come from under More options to pick a different part or to keep the whole object as one row.

Can I keep lists as one cell instead of many columns?

Yes. Set Lists inside a record to Joined into one cell, with the separator you want, or to JSON text in one cell.

Is my JSON uploaded?

No. It is read and converted in your browser tab, so private data stays on your device.