What this does
Expands a flat JSON object of paths back into nested objects and arrays. It understands dot paths (a.b.c), bracket indexes (a[0]), quoted keys (["a.b"]), and any custom separator.
How paths are read
items[0].namecreates an arrayitemswhose first element has aname.- With Numeric segments become array indexes on,
items.0.namedoes the same. Turn it off to keep0as an ordinary object key. - Gaps in an array, such as only
list[2]being present, are filled withnull. Indexes above 100,000 are rejected so a typo cannot allocate a huge array.
Conflicts
If one path is a value and another path goes through it (a and a.b), the tool stops and names the path that conflicts instead of silently dropping data. Keys such as __proto__ are treated as ordinary data and cannot affect the page.
Example
Input:
{"user.name":"Ada","user.emails[0]":"a@x.io","user.emails[1]":"b@x.io"}Result:
{
"user": {
"name": "Ada",
"emails": ["a@x.io", "b@x.io"]
}
}Privacy
Everything runs in your browser. Your input is never uploaded, stored, or put in the page URL.