Unflatten JSON Online.
Rebuild nested JSON from flat keys using dot notation, bracket notation, slash paths, or underscore keys. Auto-detect delimiters, turn numeric paths into arrays, and copy clean nested JSON instantly.
No signup · No uploads · Auto-detect delimiter
Nested JSON output
Unflatten JSON from flat keys
A JSON unflatten tool converts one-level JSON objects
back into nested data. Flat keys such as user.address.city
become real nested objects, while numeric paths such as
users.0.email can rebuild arrays. It is useful when a
spreadsheet export, log pipeline, analytics tool, database column map,
or flattened API response needs to become structured JSON again.
How to unflatten JSON in three steps
- Paste flat JSON with path-like keys into the input.
- Choose delimiter - auto-detect, dot, bracket, slash, or underscore.
- Rebuild nested JSON, then copy or download the result.
Dot notation, bracket notation, slash, and underscore
Different systems flatten keys in different ways. This
unflatten JSON online tool handles dot notation
(user.name), bracket notation (user[name]),
slash paths (user/name), and underscore keys
(user_name). Auto-detect works well for common exports,
while manual delimiter selection gives you control when a dataset has
unusual key names.
Rebuild arrays from numeric keys
Keys like roles.0 and roles.1 can become
arrays instead of objects when numeric-key coercion is enabled. Disable
it when numbers are meaningful object property names. This makes the
tool flexible for API payloads, NoSQL exports, log events, and form
data.
How the structure gets rebuilt
Flat path keys become real nesting:
{
"user.name": "Ada",
"user.address.city": "London",
"user.tags.0": "admin",
"user.tags.1": "dev"
} becomes:
{
"user": {
"name": "Ada",
"address": { "city": "London" },
"tags": ["admin", "dev"]
}
}
The rule is simple and worth knowing: a numeric path segment
(tags.0) creates an array, and a
named segment (address.city) creates an
object. That is the whole heuristic — and it is why the
flatten tool preserves indexes rather than
discarding them.
Turning a spreadsheet back into nested JSON
This is the most common real use. A spreadsheet cannot hold nested data, so exports arrive with dot-notation headers:
name,address.city,address.zip
Ada,London,E1 6AN
Alan,Cambridge,CB2 1TN
Run it through the CSV to JSON converter to get flat
JSON, then unflatten it here and the nesting comes back: address
is an object again, not two stray columns. It is the fastest route from
“someone sent me a spreadsheet” to “my API can consume this”.
The one case that breaks
If a key genuinely contains your delimiter — an actual field named
"user.name" rather than a nested user object — the
path is ambiguous and no tool can tell the two apart. Pick a delimiter that
never occurs in your real keys, such as a slash or a double underscore, and the
round trip stays lossless.
Reverse flatten JSON safely
The conversion runs entirely in your browser, so private data stays on your device. Need the opposite direction? Use JSON Flatten to turn nested JSON into flat path keys, or inspect the rebuilt structure with JSON Viewer. For a deeper walkthrough, read how to unflatten JSON.
FAQ
Unflatten JSON, answered.
How do I unflatten JSON online? +
Paste a flat JSON object into the JSON Unflatten tool, keep Auto detect selected or choose the delimiter, and press Unflatten JSON. The tool rebuilds nested objects and arrays from path-like keys.
Can this rebuild nested JSON from dot notation keys? +
Yes. Dot notation keys such as user.address.city become nested objects like user > address > city. Numeric dot keys such as users.0.name can also become arrays when numeric-key coercion is enabled.
Does it support bracket notation JSON keys? +
Yes. The tool can unflatten bracket notation keys such as user[address][city], plus slash paths like user/address/city and underscore keys like user_address_city.
How does delimiter auto-detect work? +
Auto detect checks the flat keys and chooses bracket, slash, dot, or underscore parsing. If your keys use a mixed or unusual pattern, choose the delimiter manually for the most predictable result.
Can I turn numeric keys into arrays? +
Yes. With Coerce numeric keys to arrays enabled, keys such as roles.0 and roles.1 rebuild into a JSON array. Turn it off if numeric keys should stay as object properties.
Is my flat JSON uploaded? +
No. Unflatten JSON runs entirely in your browser. Your data is never uploaded, stored, logged, or sent to a server.
What does unflattening JSON do? +
It rebuilds nested structure from flat path keys. { "user.address.city": "London" } becomes { "user": { "address": { "city": "London" } } }. It is the exact inverse of flattening, and it is how you turn a spreadsheet export, an environment file, or a form submission back into real nested JSON.
How does it know whether to build an object or an array? +
By the path segment. A numeric segment like tags.0 signals an array index, so an array is created; a non-numeric segment like address.city signals an object key. This is why the flatten tool preserves indexes — without them, tags.0 and tags.1 would rebuild as an object with the keys "0" and "1" rather than a real array.
What if my keys already contain a dot? +
That is the one case where the round trip breaks, because the delimiter becomes ambiguous — a key literally named "user.name" is indistinguishable from a nested user object with a name field. Choose a delimiter that does not appear in your real key names, such as a slash or a double underscore.
Can I use this to turn a CSV export back into nested JSON? +
Yes, and it is a common workflow. Convert the CSV to flat JSON with the CSV to JSON converter, then unflatten it here to restore the nesting that the spreadsheet could not represent. Dot-notation column headers like address.city are exactly what makes this work.