Home Tools Blog About

JSON to CSV Converter

In short

Turns a JSON array into CSV or TSV. Nested fields become their own columns, every key gets a column even if only some rows have it, and you can convert CSV back to JSON.

  • Runs in your browser
  • Nothing uploaded
  • Free, no sign-up
Convert
Quoting, line endings and Excel options
Runs in your browser; the data you paste or open is not uploaded.
🛡
Private by designYour files and text stay in this tab
⚡
Runs in your browserNo waiting for a server
💧
No watermarksClean output you can use
🆓
FreeNo account needed

How to Use JSON to CSV Converter

JSON to CSV Converter · free online tool · All Tools Verse
The JSON to CSV Converter tool, as it looks in your browser.
  1. Paste or open a JSON file. An array of objects works best. If the array sits inside an object, Rows from picks it for you.
  2. Pick a separator. Comma for most uses, Semicolon for Excel in regions that use a decimal comma, Tab for TSV.
  3. Adjust the options. Choose how nested objects and arrays are written, and switch on the Excel helpers if the file is for a spreadsheet.
  4. Check the preview table. It shows the first 50 rows as columns, so you can see that each value landed in the right place.
  5. Copy or download. Press Copy result, or Download to save a .csv or .tsv file. Switch to CSV to JSON to convert a file back.

Example: an order export with nested fields

The Sample button loads three orders. Each has a nested customer object, a list of items, and some awkward values: a name with a comma, a name with quotes, a note with a line break, a zip code that starts with 0 and a key that only one order has.

{
  "orders": [
    {
      "id": 1001,
      "customer": {
        "name": "Smith, Anna",
        "zip": "02134"
      },
      "items": [
        "pen",
        "notebook"
      ],
      "total": 12.5,
      "paid": true,
      "note": null
    },
    {
      "id": 1002,
      "customer": {
        "name": "Lee \"JJ\" Park",
        "zip": "10001"
      },
      "items": [
        "stapler"
      ],
      "total": 7,
      "paid": false,
      "note": "Leave at\nfront desk"
    },
    {
      "id": 1003,
      "customer": {
        "name": "Ola Nordmann"
      },
      "items": [],
      "total": 30.25,
      "paid": true,
      "coupon": "SPRING10"
    }
  ]
}

The tool finds the array at $.orders by itself and writes:

id,customer.name,customer.zip,items,total,paid,note,coupon
1001,"Smith, Anna",02134,"[""pen"",""notebook""]",12.5,true,,
1002,"Lee ""JJ"" Park",10001,"[""stapler""]",7,false,"Leave at
front desk",
1003,Ola Nordmann,,[],30.25,true,,SPRING10

The status line reads 3 rows × 8 columns · 5 fields quoted. The customer fields became customer.name and customer.zip, the coupon that only order 1003 has still got its own column, and every value that contains a comma, a quote or a line break was wrapped in quotes so a spreadsheet reads it as one cell.

How each option changes a row

The same record, {"id": 7, "user": {"name": "Ann", "city": "Oslo"}, "tags": ["new", "vip"]}, converted with different settings:

Setting Header row Data row
Default: own columns, arrays as JSON id,user.name,user.city,tags 7,Ann,Oslo,"[""new"",""vip""]"
Nested objects: JSON text in one cell id,user,tags 7,"{""name"":""Ann"",""city"":""Oslo""}","[""new"",""vip""]"
Arrays: join values with "; " id,user.name,user.city,tags 7,Ann,Oslo,new; vip
Arrays: one column per item id,user.name,user.city,tags.0,tags.1 7,Ann,Oslo,new,vip
Arrays: first item only id,user.name,user.city,tags 7,Ann,Oslo,new

How tricky values are written

These cells come straight from the tool. The quoting follows RFC 4180, the CSV format that Excel, Google Sheets and most databases read: a field with a comma, a double quote or a line break is wrapped in double quotes, and a double quote inside it is written twice.

Value with In JSON CSV cell (default) With both Excel options on
a comma "Smith, John" "Smith, John" "Smith, John"
double quotes "He said \"hi\"" "He said ""hi""" "He said ""hi"""
a line break "line 1\nline 2" "line 1↵line 2" "line 1↵line 2"
a leading zero "02134" 02134 "=""02134"""
a formula "=SUM(A1:A9)" =SUM(A1:A9) '=SUM(A1:A9)
null null empty empty
true true true true

Keep leading zeros writes ="02134", a small formula that Excel shows as the text 02134 instead of the number 2134. Protect against spreadsheet formulas puts an apostrophe in front of any text that starts with =, +, - or @, which is the defence OWASP recommends against CSV injection. Numbers are never changed, so -5 stays -5.

How it works

  • Rows come from the array you pick in Rows from. If the JSON is an object, the tool lists every array of objects it can find within four levels and starts with the largest one. A single object becomes one row.
  • Columns are the keys in the order they first appear. With Every key found in any row, a key that only some rows have still gets a column and the other rows leave it empty.
  • Nested objects become dotted column names. Arrays are written as JSON text by default because that keeps every item; you can also join them, give each item its own column, or keep only the first.
  • For TSV, tabs and line breaks inside values are written as \t and \n so each record stays on one line. Untick that option to use CSV-style quotes instead.
  • CSV to JSON reads quoted fields, doubled quotes and line breaks inside quotes, detects the separator from the first line, and turns 42, true, false and null into JSON types. Codes with a leading zero such as 02134 stay text, and dotted names like customer.zip become nested objects again.

Limits

  • Excel opens CSV with the list separator of your region. Where the decimal mark is a comma, as in Germany, France or Greece, it expects semicolons, so choose Semicolon or use Excel’s Data, From Text/CSV import.
  • Without the UTF-8 BOM, some versions of Excel show accented letters such as é as two odd characters. Tick Add UTF-8 BOM before you download if the file is for Excel.
  • Whole numbers above 9,007,199,254,740,991 in JSON lose precision when read. In CSV to JSON they are kept as text instead.
  • The preview shows the first 50 rows. The CSV itself has every row, and files of up to 30 MB can be opened.

Frequently asked questions

How do I open the CSV in Excel without breaking the columns?

Open Quoting, line endings and Excel options, tick Add UTF-8 BOM to the download, then double-click the saved file. If everything lands in column A, your Excel uses semicolons: convert again with Semicolon selected. For codes with leading zeros, tick Keep leading zeros as well.

What happens to nested JSON when it becomes CSV?

Each nested field gets its own column with a dotted name, such as customer.name. If you prefer to keep the whole object together, choose JSON text in one cell. Converting back with CSV to JSON rebuilds the nesting from the dotted names.

What is the difference between CSV and TSV?

Only the separator. CSV uses commas (or semicolons in some regions) and TSV uses a tab. TSV is handy when values often contain commas, such as addresses, and it pastes straight into a spreadsheet as separate columns.

My JSON has an outer object, not an array. Will it work?

Yes. API responses often look like {"data": [ ... ], "page": 1}. The tool finds the data array and uses it for the rows. Pick another array in Rows from, or choose Whole document to get one row.

Keep going

Related Tools

All Document tools →
Share

Embed this tool

Add this free tool to your website. Copy and paste the code: