JSON to CSV

Export an array of objects to CSV, with a selectable delimiter

How to use

The header is the union of all object keys; missing fields are left blank. If a field contains the delimiter, a quote or a newline, it is wrapped in double quotes and inner quotes are escaped per the CSV spec.

FAQ

What if each object has different keys?

The header is the union of all keys; a field missing in a row is left blank. The exported CSV has a consistent number of columns and opens directly in Excel.

Why are some cells wrapped in quotes?

Whenever the content contains a delimiter, a double quote or a newline, quotes are required, otherwise the CSV parser would split it into wrong columns.