About this tool
Give it an object whose keys are paths and it rebuilds the nested structure, creating objects for named segments and arrays for numeric ones. Both items.0.id and items[0].id styles are understood, and you can choose any separator. Turn off array creation if numeric keys should stay object keys. The conversion runs in your browser.
How to use JSON Unflatten
- Paste a flat JSON object into the left box.
- Set the separator used in your keys.
- Choose whether numeric segments create arrays.
- Copy the nested JSON.
Frequently asked questions
Why did a number become an object key instead of an array index?
Either array creation is turned off, or the same path is also used with a text segment. Turn the option on and check for conflicting keys.
What if two keys conflict?
Later keys win. For example, a: 1 followed by a.b: 2 turns a into an object containing b.