TheFileTools

How to convert JSON to CSV for Excel or Google Sheets

Turn a JSON list of objects into a table, with nested objects flattened into columns and the right separator for your spreadsheet.

A JSON export from an API or a database is hard to sort, filter or hand to a colleague. A CSV file opens in any spreadsheet program.

Steps

  1. Open JSON to CSV.
  2. Paste the JSON, or press Open a file and choose a .json file. It stays on your device.
  3. Choose the Separator: comma, semicolon or Tab.
  4. Press Download to save data.csv, or Copy to paste the table elsewhere.

What shape the JSON must have

The tool expects a list of objects, where each object becomes one row. A single object is treated as a list with one row. If the data you want sits inside a wrapper, for example under a property called results, copy only that inner list. Invalid JSON produces the parser's error message, and JSON formatter helps to find the problem.

How columns are built

  • Every key becomes a column. The header is the set of all keys found in any row, in the order they first appear. A row that lacks a key gets an empty cell.
  • Nested objects are flattened with a dot. An object user that holds name and city gives the columns user.name and user.city.
  • Lists inside a row are not expanded. They are written into one cell as JSON text, for example ["a","b"].
  • null becomes an empty cell.

Cells that contain the separator, a double quote or a line break are wrapped in double quotes, and quotes inside them are doubled, which is the standard CSV convention. The name Lee, Bo is written as "Lee, Bo".

Choosing the separator

Excel in many European language settings expects a semicolon, because the comma is the decimal sign there. If everything lands in column A when you open the file, convert again with the semicolon. Tab is the safest choice for pasting straight into a sheet.

The file is saved as UTF-8 without a byte order mark. If accented letters look wrong in Excel, use its import function and select UTF-8. To go back the other way, use CSV to JSON.