Rebuild nested JSON from a flat object whose keys are paths (user.name, tags[0]). The reverse of flattening — bracket indexes become arrays and dotted segments become nested objects.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
What unflattening does
This is the inverse of flattening: it reads a single-level object whose keys are paths and rebuilds the original nesting. {"user.name":"Asha","tags[0]":"admin"} becomes an object containing a nested user object and a real tags array. Data that arrives flat — from spreadsheets, form submissions, environment-style configs or log exports — leaves as structured JSON your code can consume.
Worked example
Input:
{
"user.name": "Asha",
"user.address.city": "Pune",
"tags[0]": "admin",
"tags[1]": "editor",
"active": true
}Output:
{
"user": { "name": "Asha", "address": { "city": "Pune" } },
"tags": ["admin", "editor"],
"active": true
}When to use it
- Restoring structure after editing flattened data in a spreadsheet.
- Converting dotted-key exports from logging or analytics systems into real JSON.
- Building nested request payloads from flat form-style field names.
- Completing a flatten → edit → unflatten round trip with the JSON Flattener.
Limitations to know
- Keys must be consistent: if one key claims
ais a value and another needsa.bto exist, the later key wins and a warning explains what was overwritten — the tool never fails silently. - Whether
tags.0means an array index or an object key named “0” is your call via the numeric-segments option; data with year-keys like"2024"usually needs it off. - Sparse indexes (only
tags[3]present) produce null slots for the missing positions, because arrays have no gaps in JSON.
Common errors and fixes
- “The input must be a flat JSON object” — the tool received an array or a scalar; the input needs to be one object whose keys are the paths.
- Everything ended up under one giant key — the data uses a different delimiter (slashes or underscores); set the matching delimiter option.
- Numbers became array indexes unexpectedly — turn off “treat numeric segments as array indexes” to keep numeric object keys as keys.
How to use the JSON Unflattener
- Paste a flat JSON object whose keys are paths, for example {"user.name": "Asha", "tags[0]": "admin"}.
- Set the delimiter used in the keys, and whether numeric segments should become array indexes.
- Click "Unflatten JSON".
- Copy the rebuilt nested JSON from the output panel.
Frequently asked questions
What input does the unflattener expect?
A single-level JSON object whose keys encode paths — dots (or your chosen delimiter) between object keys, and array indexes either in brackets (tags[0]) or as bare numeric segments (tags.0). That is exactly what the JSON Flattener produces.
How do arrays come back?
Bracket indexes always become array positions. Bare numeric segments like tags.0 become array indexes when "treat numeric segments as array indexes" is on; turn it off if your data genuinely uses numeric object keys such as {"2024": …}.
What happens when keys conflict?
If one key says "a" is a value and another says "a.b" needs "a" to be an object, the later key wins and the tool adds a warning instead of failing — so you can spot and fix the inconsistent source data.
Does unflattening preserve value types?
Yes. Strings, numbers, booleans and nulls pass through untouched; only the key structure is rebuilt.