Skip to content
{}

JSON Unflatten

Rebuild nested JSON objects and arrays from flat dot-notation key paths.

0 chars | 1 lines
0 chars | 0 lines

Conversion payloads stay in this browser tab and are never placed in page URLs - see how local processing works. Privacy-safe analytics record only the tool, outcome, and a coarse input-size bucket.

How to Unflatten JSON

Paste a flat object of path/value pairs and the tool rebuilds the nesting they describe. It walks each path segment by segment, creating arrays for numeric bracket segments and objects for everything else, so the structure is derived from the paths rather than guessed from the values.

Round-Tripping Configuration

Flatten then unflatten is a practical way to edit deeply nested configuration. Flatten a manifest to get one line per setting, edit or diff those lines, then unflatten to restore the shape the tool consuming it expects. Because empty containers are preserved as leaves, the round trip does not quietly drop an empty list that the schema requires.

Frequently Asked Questions

How does it decide between an array and an object?

A bracketed numeric segment such as items[0] creates an array; every other segment creates an object key. A quoted bracket segment like ["0"] stays an object key, which is how you keep a numeric-looking key from becoming an array index.

What input does it expect?

A flat JSON object whose keys are paths, which is exactly what the JSON Flatten tool produces. Values may be any JSON type, including empty objects and arrays.

What happens if two paths conflict?

A path that treats the same node as both an array and an object is reported as an error naming the segment, rather than being resolved by guessing. Silently picking one interpretation would produce a document that no longer matches either source.

Can I use this on .env or properties files?

Yes, once they are expressed as a flat JSON object. Converting DATABASE__HOST style separators to dots first, then unflattening, is a common way to turn a flat configuration store back into structured config.

Related Tools