Turn nested JSON into one flat object whose keys are paths, in three styles, or rebuild the nesting from a flat object. Ambiguous keys are named, not hidden.
Waiting for nested JSON
a.b[0].c — the form most config libraries accept. Ambiguous when a key itself contains a dot.
The result appears here
One flat object whose keys are paths through the original.
JSON Flatten runs entirely on your device — nothing is uploaded.
You’re on the Free plan. Compare plans
A nested document becomes one flat object whose keys are paths, which is the shape a spreadsheet column, an environment variable, a translation file and an HTML form field name all want. Three key styles are offered, and only one of them is unambiguous.
The dotted form is the familiar one and it is lossy. A key that already contains a dot produces a flat key that cannot be told apart from a nesting: an object with a single key containing a dot and an object nested one level deep both flatten to the same thing, so unflattening cannot know which it was. The tool detects exactly which keys this affects and names them, rather than letting a round trip quietly change the data.
The bracketed form distinguishes an array index from an object key, which the dotted form does not. That is a real improvement and it does not fix the ambiguity, since a key containing a dot is still indistinguishable from a level of nesting.
The JSON Pointer form is the only one with a specification behind it. It escapes a tilde and a slash inside a key, so a key containing the separator survives the round trip exactly. Unreadable for a spreadsheet header and the right choice whenever the round trip has to be exact.
Unflattening rebuilds the nesting from the paths in the keys. A key segment that is a number becomes an array index, which is what you want for an indexed path and not what you want for an object whose keys happen to be numbers — so the result is shown for you to check and the tool says what it assumed. Nothing is uploaded.
Because a key that already contains a dot flattens to something indistinguishable from a level of nesting. Unflattening cannot tell which it was. The tool lists the keys this affects so the problem is visible rather than silent.
Dotted when a person will read the keys and no key contains a dot. Bracketed when array indices need to be obvious. JSON Pointer when the round trip has to be exact, since it is the only form that escapes a separator inside a key.
Each element gets its index as a path segment. In the bracketed style that is written in brackets, which makes it distinguishable from an object key; in the dotted and pointer styles it is another segment.
Because unflattening treats a numeric segment as an array index, which is right for an indexed path and wrong for an object whose keys happen to be numbers. The result is shown so you can check it before using it.
Pick the style the keys are written in. Reading a flat object with the wrong style selected produces a wrong shape rather than an error, since both are valid key strings.
It becomes a leaf with an empty value, because there is nothing inside it to flatten. Unflattening restores it, so the round trip holds for empty containers.