JSON Flatten & Unflatten
- Round trips
- Custom delimiter
- Nothing uploaded
Nested structure to single-level dotted paths, and losslessly back again.
Paste input on the left to see result.
Everything runs in your browser — nothing is uploaded.
About flatten
Flattening JSON converts nested structure into a single level of dotted paths such as user.address.city — the shape that config systems, environment variables and spreadsheets expect. Unflattening rebuilds the nesting. JSONic preserves empty objects and arrays, so the round trip returns exactly what you started with.
Flattening turns nested structure into one level of dotted paths — the shape environment variables, feature flags, i18n catalogues and spreadsheet columns all want. Unflatten reverses it, rebuilding objects and arrays from the path segments. The delimiter and array notation are configurable, and empty objects and arrays are preserved so the round trip returns exactly what you started with.
Questions
Is the round trip lossless?
Yes, provided your keys do not themselves contain the delimiter. Empty objects and arrays are preserved as leaf values rather than dropped, which is where most flatten implementations lose data.
How are array indices represented?
Either as another path segment (items.0.name) or in bracket notation (items[0].name). Bracket notation is unambiguous when keys can be numeric; dotted is more common in config systems.
What if a key contains a dot?
Change the delimiter to something absent from your keys — a slash or a double colon. With the default dot, a key containing a dot will be split on unflatten and the round trip will not be exact.