EthicalFusion

JSON to CSV Converter

Convert a JSON array of objects into CSV format.

Was this tool helpful?

Thanks for the feedback!

The JSON to CSV Converter turns a JSON array of objects into a comma-separated table, one row per object and one column per key. It is useful for opening API data, database exports or app logs in Excel or Google Sheets, or for sending data to someone who works in spreadsheets.

Example with uneven records

Real data rarely has the same fields in every object. Given:

[
  {"name":"Priya","city":"Pune","amount":1500},
  {"name":"Rao, K.","amount":240000,"tags":["vip","gst"],"note":null},
  {"name":"Say \"hi\"","active":true}
]

the converter produces:

name,city,amount,tags,note,active
Priya,Pune,1500,,,
"Rao, K.",,240000,"[""vip"",""gst""]",,
"Say ""hi""",,,,,true

How each value is written

  • Columns are every key found in any object, in the order they first appear. A key missing from an object leaves an empty cell.
  • null becomes an empty cell; true and false are written as words.
  • Nested arrays and objects are not flattened. They are stored as JSON text in a single cell, like the tags column above.
  • Quoting follows the usual CSV convention: any value containing a comma, a double quote or a line break is wrapped in double quotes, and quotes inside it are doubled.

Rows are separated by a plain line feed. A text value that itself contains a line break, such as a multi-line address, is quoted and stays in one cell; Excel and Google Sheets display it as a cell with several lines rather than splitting the record.

Input the converter needs

The top level must be an array. A single object such as {"a":1} gives the error "Expected a JSON array of objects."; wrap it in square brackets to make it a one-row array. If your API returns the list inside a property, for example {"data":[…]}, copy only the array. An array of plain values like [1,2] has no keys, so it produces empty rows. Invalid JSON shows the parser's error message.

Opening the CSV in Excel without surprises

  • Garbled ₹ or Hindi text. The file is UTF-8 without a byte-order mark, and Excel on Windows may guess the wrong encoding when you double-click a CSV. Use Data → From Text/CSV and choose "65001: Unicode (UTF-8)", or open it in Google Sheets.
  • Lost leading zeros. Excel turns 007 or an employee code like 00451 into a number and drops the zeros unless you import that column as Text.
  • Long numbers. Excel keeps only 15 significant digits, so 16-digit account numbers or long order IDs get rounded. Import them as Text as well.

If the goal is a spreadsheet anyway, the JSON to Excel Converter skips the CSV step. Conversion happens in your browser, and the CSV to JSON Converter reverses it, though every value comes back as text.

Frequently asked questions

Why do I get "Expected a JSON array of objects"?
The top level of your JSON is an object, not an array. Wrap it in square brackets, or copy just the array from inside it.
How are nested objects and arrays handled?
They are not split into columns. Each nested value is written as JSON text inside one cell.
What happens when objects have different keys?
Every key from every object becomes a column, and objects without that key get an empty cell.
Why does Excel show strange characters instead of ₹?
Excel may not detect UTF-8 when opening a CSV directly. Import it through Data, From Text/CSV and select UTF-8.
Can I convert the CSV back to JSON?
Yes, with the CSV to JSON Converter, but numbers and true/false values will come back as strings.

Related tools

Embed this tool on your site

Paste it into any blog or website. Free, with a credit link.