JSON Flatten / Unflatten (Dot Notation)
Flatten nested JSON into dot-notation keys, or rebuild nested JSON from flat keys — configurable delimiter and array notation, fully reversible.
Output · 9 keys
{
"app.name": "demo",
"app.version": "1.2.0",
"app.features[0]": "search",
"app.features[1]": "export",
"app.server.host": "localhost",
"app.server.ports[0]": 8080,
"app.server.ports[1]": 8081,
"flags.beta": true,
"flags.maxUsers": 100
}Flatten and unflatten are exact inverses unless an object key contains the delimiter — switch delimiters if your keys have dots.
How to use
- Pick Flatten or Unflatten.
- Paste your JSON into the input box.
- Set the delimiter and array notation to match your target format, then copy the result.
About this tool
ShowHide
Paste JSON and switch between two modes. Flatten collapses a nested object or array into one flat object whose keys are paths like app.server.ports[0] — handy for environment variables, MongoDB update paths, i18n message files, CSV columns, or diffing two configs. Unflatten does the reverse, expanding flat dot-notation keys back into a nested structure. Choose the delimiter (., /, _, -) and whether arrays use bracket notation (items[0]) or dotted indices (items.0). Empty objects and arrays are preserved as leaves so a flatten → unflatten round-trip returns exactly what you put in. Everything runs locally — your JSON never leaves the browser.
Frequently asked questions
Is the conversion reversible?
Yes, for normal data. Flattening then unflattening with the same delimiter and array notation returns an identical object — empty objects/arrays and null values are kept as leaves so nothing is lost. The one exception is below.
What if an object key contains the delimiter?
Then the round-trip is ambiguous: a key like a.b flattened with the . delimiter is indistinguishable from nested a → b, so unflatten will split it. If your keys contain dots, pick a different delimiter (e.g. /) that doesn't appear in them.
How are array indices handled?
In bracket mode arrays become list[0], list[1]; in dot mode they become list.0, list.1. On unflatten, a bracket index is rebuilt as an array element, and with dot notation selected so is a bare numeric segment, so a flat key users.0.name produces an array of objects. With bracket notation a bare numeric segment such as responses.200 stays an object key, which is why objects keyed by numbers (HTTP status codes, IDs) round-trip in bracket mode but not in dot mode. An index above 100000 is always kept as an object key rather than padding an array with that many nulls.
Does it modify my data types?
No. Numbers, booleans, null, and strings are preserved exactly as JSON values; only the key structure changes. Output indentation (0/2/4 spaces) only affects formatting, not content.
Related tools
JSON Sort Keys
Sort the keys of a JSON object alphabetically. Optionally recurse into nested objects so the whole document is canonicalized.
Developer
SSH Public Key Inspector
Read an SSH public key, authorized_keys or known_hosts line: algorithm, key size, SHA256 and MD5 fingerprints, comment and options.
Developer
Static Library (.a) Inspector
Read a .a archive in the browser: members with sizes and dates, the symbols each object defines and needs, and whether the symbol index has gone stale.
Developer
Unicode Escape Converter
Encode text to \uXXXX, U+XXXX or HTML entities — and decode any of those back to text. Handles emoji and astral characters.
Developer
CBOR Decoder (Diagnostic Notation)
Decode CBOR (RFC 8949) from hex or base64 into readable diagnostic notation — including tags, floats and indefinite-length items. All in your browser.
Developer
JSON Formatter & Validator
Format, beautify, minify, and validate JSON right in your browser.
Developer