Skip to content

Flatten nested JSON into a table

Nested objects and arrays do not fit neatly into a CSV or a database table. flatten turns a nested structure into flat records: nested objects become dotted columns (contact.address.city) and a nested array can be expanded so that each element becomes its own row.

jsonreshape flatten data.json flat.jsonl --children-key children

Then convert the flat result to any table format:

jsonreshape convert flat.jsonl flat.csv

Expand a nested array into rows

When converting straight to a table, you can expand (explode) one array:

jsonreshape convert data.json table.xlsx --array-mode rows --explode orders

Structure builder (desktop)

For full control, the Structure builder lets you drag source fields into the output shape and see a live preview, then save the mapping and apply it to the whole file:

jsonreshape apply structure.mapping.json data.json new.json

The structure builder