Nested JSON Flattener

Flatten nested JSON to dot-notation keys, unflatten back, and export flat CSV.

Free nested JSON flattener: turn deeply nested JSON into flat dot-notation key/value pairs, unflatten them back into structured JSON, and export the flat table as CSV. Choose your delimiter and array notation. Runs entirely in your browser — nothing is uploaded. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What does flattening nested JSON mean?

Flattening walks every branch of a nested JSON object or array and collapses each leaf value into a single key that records its full path, joined by a delimiter. For example the nested value at order then customer then name becomes the flat key order.customer.name. The result is a one-level object of path/value pairs that is easy to scan, diff, search, or load into a spreadsheet.

The Nested JSON Flattener turns awkward, deeply nested JSON into a clean, one-level map of dot-notation keys and their values — and reverses the process just as easily. It is built for developers, data engineers, QA testers, and analysts who need to inspect a payload, diff two API responses, build a flat config, or move JSON into a spreadsheet without hand-editing brackets. Paste any object or array, and every leaf value gets a key that spells out its full path, like order.customer.name or order.items.0.sku. Switch to Unflatten and the same tool rebuilds the original nested structure from those flat keys, so the conversion is a true round-trip rather than a one-way dump.

How it works

The flattener walks the entire JSON tree recursively. Each time it reaches a primitive value — a string, number, boolean, or null — it records the joined path as a key. Objects contribute their property names; arrays contribute their numeric index. You control two things that matter for downstream tools: the delimiter that joins path segments (a dot by default, but you can use a slash, underscore, or anything short), and the array notation. Dotted indexes produce items.0.price; bracket notation produces items[0].price. The Keep empty option decides whether empty objects and arrays are preserved as explicit {} and [] leaf markers so the shape survives a round-trip.

Unflattening reverses all of this. It splits each key back into path segments, normalising bracket notation to indexes first, then walks down the structure creating objects or arrays as needed. A numeric token tells it to build an array; anything else builds an object. If every top-level key is numeric, the root itself collapses back into an array. Because the logic is symmetric, flattening then unflattening with the same settings returns exactly what you started with.

Example

Given an order object with a nested customer and a two-item array, flattening produces keys such as order.id, order.customer.name, order.customer.tags.0, order.items.0.sku, order.items.0.qty, and order.items.1.price. The summary line reports the number of leaf keys and the maximum nesting depth, and the scrollable table previews every pair.

Flat keyValue
order.idA-1007
order.paidtrue
order.customer.nameAda Lovelace
order.items.0.skuBK-01
order.items.1.price3.2

Click Export flat CSV and those rows download as a quoted two-column spreadsheet ready for Excel, Google Sheets, or a database import — generated locally, with nothing ever leaving your browser.