JSON to CSV Converter

Convert a JSON array of objects into a properly-escaped CSV table.

Why use this tool?

Convert a JSON array of objects into CSV you can open in Excel or Google Sheets. Columns are collected from every object, and values are escaped properly.

How to use it

  1. Paste a JSON array like [{...}, {...}].
  2. Click Convert.
  3. Copy the CSV.

How the conversion works

CSV is a table: one header row of column names, then one row per record. JSON is more flexible, so the converter has to decide what the columns are. It reads every object in the array and collects every key it finds, in the order they first appear. Each key becomes a column, and each object becomes a row.

If an object doesn't have a particular key, that cell is left empty. Null values are also written as empty cells. A single JSON object (not wrapped in an array) is treated as a one-row table.

Escaping: commas, quotes and line breaks

A comma inside a value would split it into two columns, so any value containing a comma, a double quote or a line break is wrapped in double quotes. Double quotes inside the value are doubled. For example, the value Los Angeles, CA is written as "Los Angeles, CA", and the value say "hi" becomes "say ""hi""". This is the standard CSV format described in RFC 4180, which Excel, Google Sheets and most databases read correctly.

Nested objects and arrays don't fit in a single cell, so they're written as JSON text inside the cell. For [{"name": "Ana", "tags": ["admin", "editor"]}] the tags column contains ["admin","editor"]. If you need each nested field in its own column, flatten the data first, for example turning {"address": {"city": "Lyon"}} into {"address_city": "Lyon"}.

Worked example

Input: [{"name": "Alice", "age": 30, "city": "New York"}, {"name": "Bob", "city": "Los Angeles, CA", "email": "bob@example.com"}]. The converter finds four keys across the two objects, so the header is name,age,city,email. Alice's row has no email, so it ends with an empty cell: Alice,30,New York, with a trailing comma. Bob has no age, so his row is Bob,,"Los Angeles, CA",bob@example.com, with an empty age cell and the city quoted because it contains a comma.

Opening the result in Excel or Google Sheets

Google Sheets: paste the CSV into cell A1 and choose Data → Split text to columns, or save it as a .csv file and import it with File → Import. Excel: save the text as a .csv file and open it, or use Data → From Text/CSV, which lets you pick the delimiter and the file encoding.

If accented letters or other non-English characters look garbled in Excel, import with Data → From Text/CSV and choose UTF-8 as the encoding. Excel may also turn long numbers such as phone numbers or IDs into scientific notation or drop leading zeros; set those columns to Text during import to keep them exactly as they are.

Frequently asked questions

My JSON has different keys in different objects. Is that a problem?

No. Every key from every object becomes a column, and objects without a given key get an empty cell in that column.

Why do some values have quotes around them?

Values containing a comma, a double quote or a line break must be quoted in CSV, otherwise they'd be split into separate columns or rows.

Is my data uploaded anywhere?

No. The conversion runs in your browser, so the JSON you paste isn't sent to a server.