Skip to content
Utilerio

JSON Flatten / Unflatten

Flatten nested JSON to dot/bracket-path keys, or rebuild the nested structure from flat keys.

Was this tool useful?

About this tool

A deeply nested JSON document doesn't fit a spreadsheet column, an env variable, or a form field particularly well — flattening it to `parent.child[0].grandchild`-style keys does. Unflattening reverses the same operation, for whichever direction the day's task needs.

How to use it

  1. Flatten mode: paste a nested JSON value, get back a flat object of dot/bracket-path keys.
  2. Unflatten mode: paste a flat object of such keys, get back the reconstructed nested structure.

Examples

Flattening a nested address

{ "user": { "address": { "city": "London" } } }
{ "user.address.city": "London" }

Common problems

Unflatten fails on a document that isn't a plain object.
Unflatten expects a flat object as input (the direct output of Flatten mode) — a JSON array or a primitive value at the top level has no keys to rebuild from.

Frequently asked questions