Maaz Zindani

Loading the index…

↑↓ move↵ openesc close3993 pages

Free tool · Developer tools

JSON to CSV

Paste a JSON array of objects and get a CSV with one row per object. Nested objects become dot-path columns, quotes follow RFC 4180, and you can copy the text or download a .csv file.

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

By Maaz Zindani · Updated

Delimiter
Arrays of values
Line breaks
Options
CSV

2 rows7 columns, comma delimiter, 135 bytes

id,name,address.city,address.zip,tags,note,active 1,Anna Smith,Paris,75001,admin|dev,"Says ""hi"", then leaves", 2,Ben,Oslo,,,,true
  • Quotes doubled per RFC 4180
  • Arrays of values joined with |
  • CRLF line breaks
  • 1 column not in the first object; missing values are left empty.
Preview, first 2 of 2 rows
idnameaddress.cityaddress.ziptagsnoteactive
1Anna SmithParis75001admin|devSays "hi", then leaves
2BenOslotrue

How to use the JSON to CSV

  1. Paste your JSON into Your JSON (an array of objects), or choose a .json file. It is read on your device.
  2. Pick the Delimiter: comma, semicolon, tab or pipe. Semicolon suits spreadsheets set to many European formats.
  3. Choose what happens to Arrays of values: join them with a pipe or write them as JSON, and set the line breaks and header row.
  4. Check the preview table, then press Copy or Download .csv.

How do I convert JSON to CSV?

CSV is a flat grid: every row has the same columns. JSON is a tree. To convert, the tool reads the top-level array and treats each object as a row. The columns are the keys it meets, in the order it first sees them. The example in the box has two objects, 2 rows and 7 columns, and the first line of the result is id,name,address.city,address.zip,tags,note,active.

If your JSON is a single object, it becomes one row. If it is an object wrapping one array, such as {"data": [ ... ]}, the page uses that array and says so. If the array holds plain values like [1, 2, 3], you get one column named value. Numbers keep their written form, true and false stay as words, and null becomes an empty cell. Very large integers lose precision when any JavaScript tool parses the JSON, so keep IDs beyond 15 digits as strings. To go the other way, the CSV to JSON converter reads a CSV back into an array of objects.

Here is the worked example from the box. The first object has an id, a name, an address with two fields, two tags and a note with quotes and a comma. The second object has no zip, no note, an empty tag list and an extra active key. The result has the header line above and then 1,Anna Smith,Paris,75001,admin|dev,"Says ""hi"", then leaves", for Anna and 2,Ben,Oslo,,,,true for Ben. Notice how the empty cells keep every row at the same width, which is what a CSV reader expects.

The preview under the result shows the first 20 rows as a table, so you can check the columns before you copy anything. Copy and Download always carry the full text, even when the box shows only the first part of a very large result. Input up to 5 MB is accepted; beyond that the page says so rather than freezing your browser.

How do I flatten nested JSON for CSV?

Nested objects are flattened with dot keys. {"address": {"city": "Paris", "zip": "75001"}} becomes two columns, address.city and address.zip, however deep the nesting goes. An empty nested object is written as {}.

Arrays have no single correct CSV form, so the page lets you choose. With Join with |, an array of plain values becomes one cell: ["admin", "dev"] is written admin|dev. With Write as JSON, the same array is written as ["admin","dev"], which you can parse again later. An array that contains objects or other arrays is always written as JSON, because joining would lose the structure. An empty array is an empty cell.

When objects have different keys, the columns are the union of all keys, and a missing value is left empty. The page tells you how many columns appeared only after the first object, so a typo in one record is easy to spot. If the same flattened name could come from two places, such as a key literally called "a.b" next to {"a": {"b": 1}}, both land in one column, so rename one first.

How are quotes, commas and line breaks handled in CSV?

The converter follows RFC 4180, the document that registers the text/csv format. A field that contains the delimiter, a double quote or a line break is wrapped in double quotes, and a double quote inside a field is written twice. Records end with CRLF by default, which is what the RFC specifies; you can switch to LF. Fields are not trimmed, because the RFC treats spaces as part of the field, and a field with leading or trailing spaces is quoted so they survive.

The delimiter changes what needs quoting: a comma inside a value is only quoted when the delimiter is a comma. In the example the note Says "hi", then leaves is written as "Says ""hi"", then leaves".

What the quoting rules do with a comma delimiter
CaseValueWritten asWhy
Plain textAnna Smithas isNo special character.
Contains the delimiterSmith, Anna"Smith, Anna"A comma would split the field.
Contains a double quoteSays "hi""Says ""hi"""Quotes inside are doubled.
Contains a line breakline 1 line 2"line 1\nline 2"A line break would start a new record.
Leading space padded" padded"Spaces are part of a field, so it is quoted to keep them.

Spreadsheets run text that starts with =, +, - or @ as a formula. If your data comes from users, turn on Guard against spreadsheet formulas: the converter then puts an apostrophe in front of such text cells, and leaves real numbers like -5 alone. To open the file in a spreadsheet with accented letters, try the byte order mark option, which some programs need to read UTF-8. For tidying the JSON before you convert, the JSON formatter checks and formats it.

Use it with

Questions

How do I convert JSON to CSV?

Paste a JSON array of objects. Each object becomes a row and each key a column. Check the preview, then copy the text or download the .csv file.

How do I flatten nested JSON for CSV?

Nested objects become columns named with dots, such as address.city. Arrays of plain values are joined with a pipe or written as JSON, your choice, and arrays of objects are written as JSON.

How do I open the result in Excel?

Download the .csv and open it from your spreadsheet program. If it puts everything in one column, choose the semicolon or tab delimiter that matches your regional setting. If accents look wrong, download again with the UTF-8 byte order mark option on.

What if objects have different keys?

The columns are every key from every object, in the order first seen. A record without a key gets an empty cell, and the page counts the columns that appeared late.

How do I keep unicode characters in the CSV?

The text is never converted away from Unicode, so accents, emoji and non-Latin scripts stay as typed. The download is UTF-8, with an optional byte order mark for programs that need it.

Is my JSON uploaded anywhere?

No. The conversion runs in your browser and nothing you paste or open leaves your device.

How this page was made: the tool's results are computed in your browser by the code on this page, using the sources listed above; the explanations were drafted with AI help and checked against the tool's own output.