JSON to CSV Converter

Convert a JSON array of records into CSV, with columns collected from all objects and optional spreadsheet protection.

Text is processed locally in your browser and is not uploaded.

Records
2
Columns
2

How to use this tool

  1. Paste a nonempty JSON array in which each item is an object.
  2. Keep formula-like text protection enabled when opening untrusted strings in a spreadsheet.
  3. Select Convert to CSV and review the generated header and empty cells.

Understanding the output

The header contains every distinct key in first-seen order. Missing properties and null values become empty cells. Nested arrays or objects are serialized into a JSON string inside their cell; they are not expanded into separate columns.

Records with different fields

For [{"a":"x,y"},{"b":2}], the header is a,b. The first row contains a quoted x,y value and an empty b cell; the second row contains an empty a cell and 2.

Choose a table shape deliberately

JSON can represent nested and irregular structures, whereas a CSV table has a fixed set of columns. Combining keys is convenient for records with optional fields, but deeply nested data may be better flattened in your application first. This converter preserves a nested value as a JSON string so that it is visible instead of silently discarding it.

CSV does not carry reliable type information. An empty cell cannot distinguish a missing property from a null or an empty string after export. If these differences matter, keep the original JSON as the authoritative representation.

Consider how a spreadsheet will interpret cells

Some spreadsheet applications treat strings beginning with characters such as = or + as formulas. The optional protection prefixes formula-like text with an apostrophe, including suspicious leading whitespace. This changes the exported text intentionally. It reduces a common risk but is not a universal security guarantee: import settings and spreadsheet behavior differ, so inspect untrusted exports before opening them.

Method and supported input

Native JSON parsing reads the array. A union of object keys creates the header, and CSV serialization quotes commas, quotes, and line breaks while doubling internal quotes.

  • Each array item represents one record.
  • Native JavaScript number precision is sufficient for the input.

Limitations

  • Duplicate JSON keys and very large numeric precision are not preserved. Numbers outside JavaScript’s finite numeric range are rejected.
  • The tool accepts at most 10,000 records and 200 columns.

Common questions

Will nested objects become separate columns?

No. They become JSON text inside a single CSV cell.

Why did an apostrophe appear before a value?

Spreadsheet protection prefixes formula-like strings. Turn it off only when you need exact text and understand how the destination handles it.

Sources and further reading