JSON flatten / unflatten
ClientConvert nested objects to a single-level map with dot keys, or reverse the process from a flat JSON object.
Learn more: flat keys
Turn nested objects into dot paths (and array indices as numeric segments), or rebuild nesting from a flat map—common for environment variables and some i18n bundles.
Round-trip
Flatten produces one key per leaf. Unflatten expects an object whose keys are those paths; values should be primitives or JSON-encoded strings for complex leaves.
Flatten & unflatten
?
Nested objects become keys like user.profile.city. Array indices appear as numeric segments. Paste a flat object back to rebuild nesting.
Common use cases
- Turn nested config into flat key=value maps for env files, feature flags, or translation tables.
- Inspect deep structures as a sorted list of paths when debugging unknown JSON.
- Round-trip flatten → unflatten to confirm dot-path conventions before importing into spreadsheets or databases.
Common mistakes to avoid
Keys that already contain dots
Flattening encodes structure with dots in path names. If a real key contains a dot, round-trip may need quoting rules—verify your consumer’s expectations.
Losing array order when treating indices as strings
Numeric indices are usually ordered as array slots. After unflattening, confirm the array length matches what you expect.
FAQ
Does flattening upload my JSON?
No. Conversion runs entirely in your browser tab.
Is this the same as JSON Pointer paths?
Both use path-like strings, but flattening produces a flat object keyed by those paths. Pointers (RFC 6901) address a single node inside one document—related concepts, different outputs.
More tools
Related utilities you can open in another tab—mostly client-side.
JSON ↔ Properties
ClientJava-style .properties lines ↔ nested JSON—comments skipped, client-side.
JSON sort keys
ClientRecursively sort object keys for stable JSON text—pretty or minify, client-side.
JSONPath & JMESPath
ClientQuery large JSON with JSONPath or JMESPath—results panel, runs in your tab.
JSON formatter
ClientJSON format online: pretty-print, minify, validate, escape, download .json.