JSON to CSV

Paste an array of objects, get CSV. Nested keys are flattened with dots; the column set is the union of every row.

CSV
—
Rows
—
Columns
—

Worked example

When rows have different keys, the column set is the union — a row without vip gets an empty cell rather than shifting the remaining columns left.

CSV is a flat table; JSON is a tree. Converting between them means deciding what happens to the parts that do not fit, and that decision is where most converters quietly lose data.

Flattening

A nested object {"address":{"city":"Boston"}} becomes a column named address.city. This preserves the nesting in the header, which is round-trippable if you later un-flatten. Turn it off to get [object Object] — occasionally useful to see which columns are nested.

Arrays

Arrays are serialised as JSON strings inside a single cell rather than spread across columns. Spreading them would require a rule for which array index maps to which column, and there is no rule that works for arbitrary data.

Ragged rows

The column set is the union across all rows, so a field present in one row appears in every row. This is why the output is wider than the first row suggests, and why missing values appear as empty cells rather than absent columns.