L LocalUse Source

Flatten & Unflatten JSON

Collapse a deeply nested document into flat dot-notation keys - the shape that i18n files, feature flag stores and environment configs usually want - or reverse the process.

Direction
Separator
Max depth
JSON
Output

Output appears here as you type.

Runs entirely in your browser. Nothing you paste here is uploaded or stored.

Questions

Is my data uploaded anywhere?

No. The conversion is a pure function running in your browser tab. Nothing is transmitted, which is what makes it safe for production exports.

How are array elements represented?

As bracketed indices by default, so items[0].name. Switch to dotted indices if the consumer on the other end expects items.0.name, which some i18n libraries do.

Does unflatten reverse flatten exactly?

For the common cases, yes. It is not a perfect round trip when your original keys themselves contain the separator character - a key literally called "a.b" is indistinguishable from nesting once flattened.

More convert tools