JSON to CSV

Convert an array of JSON objects into CSV with a combined header row. Prepare simple records for a spreadsheet or import tool.

Processed locally in your browser. Maximum input: 1 MB.

CSV cells are preserved literally. Spreadsheet software may interpret cells beginning with =, +, -, or @ as formulas.

Developer Tools

Convert an array of JSON objects into CSV with a combined header row. Prepare simple records for a spreadsheet or import tool.

How to use

Paste a nonempty array of objects and generate CSV. Keys found across all objects become columns, and missing values become empty cells.

Example

[{"name":"Ada","city":"London"},{"name":"Sam"}] creates name and city columns, with an empty city for Sam.

FAQ

What happens to nested objects?

They become JSON text inside a quoted cell. Flatten nested data first if the receiving system expects separate columns.

Related tools

A practical task

Inspect the combined header when records have different keys. A field present only in later objects still becomes a column. Keep the header with the exported rows so a receiving spreadsheet does not mistake the first record for column names.

Another useful question

Can I preserve an object hierarchy in CSV?

A flat table cannot express the same hierarchy directly. Nested values become text; flatten specific fields first when the import expects separate columns.

Details for interpreting the result

Detail Explanation
Quoted CSV fields In comma separated CSV, a field containing a comma, quote, or line break needs quotes around it. A quote inside that field is doubled. Splitting every comma by hand loses those field boundaries.
Column headers Headers provide names for columns; they are not extra data values. Keep their order aligned with each row. When building objects, duplicate header names create ambiguity about which value belongs to a key.
Strings and values The JSON string "12" differs from the number 12, and "false" differs from false. Type changes affect comparisons and imports. Keep identifiers as strings when their leading zeros or exact digits matter.
Empty and missing data An empty string, a missing property, and null express different states in structured data. A flat table can merge some of those distinctions. Confirm how missing cells should be handled before converting records.
CSV and spreadsheets CSV stores text and delimiters, not cell formatting. A spreadsheet can interpret a value beginning with a formula marker when opening it. Review imported files rather than assuming quoted cells cannot be interpreted.
Numeric precision JavaScript numbers cannot represent every large integer exactly. Long account numbers, order identifiers, and arbitrary precision decimals should remain strings or use a suitable numeric library in the receiving application.
Workbooks and sheets An XLSX workbook can contain several worksheets, formulas, formatting, and hidden context. A CSV export represents one flat table. Select the intended sheet and retain the workbook when that extra context matters.