JSON Flattener

Flatten nested JSON into a single level of dot-notation keys.

Collapsing the nesting

Deeply nested JSON is precise but awkward for some tools — spreadsheets, certain databases, flat config formats — that expect a single level of keys. Flattening collapses the nesting into one level, joining the path to each value with dots, so a nested field becomes a key like user.address.city. This turns a nested document into a flat set of key-value pairs.

Paste nested JSON and it is flattened.

Where flattening helps

The flat form shines when you need to map JSON onto something that is not hierarchical: turning records into spreadsheet columns, feeding a flat key-value store, or diffing two documents field by field. Arrays are usually flattened by index, so each element gets its own indexed key. The process is reversible in principle — the dotted keys record the original structure — so flattening for one purpose does not lose the shape, it just presents it differently.

Common questions

How are nested keys represented?

By joining the path with dots, so a nested field becomes a key like user.address.city, with arrays flattened by index.

When is flattening useful?

When mapping JSON onto flat structures — spreadsheet columns, key-value stores — or diffing documents field by field.

Is my JSON uploaded?

No. The flattening happens in your browser.

More Developer tools