"user.name": "Alice")
Nested JSON will appear here
Paste flattened JSON and click Unflatten// restore dot-notation JSON back into nested objects
Restore dot-notation flattened JSON back into deeply nested objects and arrays instantly. Free, browser-based, no sign-up required.
"user.name": "Alice")
Nested JSON will appear here
Paste flattened JSON and click UnflattenPaste your flat JSON object with dot-notation keys like "a.b.c": "value" into the input area.
Select the delimiter used in your keys (default is dot) and your preferred output indentation.
The nested JSON is restored instantly. Numeric indexes are auto-converted back to arrays.
JSON Unflattener is the reverse of JSON flattening. When developers flatten a nested JSON object, all keys are joined with a delimiter (e.g. user.address.city). This tool reconstructs the original nested hierarchy from those dot-notation keys — including converting numeric keys back to proper arrays.
A flattened JSON object is one where all nested keys are collapsed into a single level using a delimiter. For example, {"user": {"name": "Alice"}} becomes {"user.name": "Alice"}. This format is common in environment variable configs, CSV exports, and some database schemas.
When unflattening, numeric keys such as "tags.0", "tags.1" are automatically detected and converted into proper JSON arrays. The tool sorts numeric indexes and returns a clean array rather than an object with numeric string keys.
Yes. The tool supports dot (.), forward slash (/), underscore (_), hyphen (-), pipe (|), and colon (:) as delimiters. Simply select the one matching your flattened data before clicking Unflatten.
If a key naturally contains the delimiter character (e.g. a key literally named user.name that is not meant to be split), you should switch to a different delimiter that doesn't appear in your keys, or escape the keys before processing.
Yes — the JSON is sent to our server-side PHP endpoint for processing. However, we do not store, log, or share any input data. Processing happens in real time and data is immediately discarded after the response is sent.
JSON Formatter pretty-prints or minifies existing JSON without changing its structure. JSON Unflattener actually transforms the shape of the data — turning flat dot-notation keys into a nested hierarchy. Use the Formatter after unflattening to control indentation.
JSON unflattening is the process of restoring a flat, single-level JSON object — where all keys use a delimiter like a dot to represent hierarchy — back into its original deeply nested structure. It is the direct inverse of JSON flattening, which collapses nested objects into a flat key-value map for storage or transport purposes.
For example, a flattened JSON object might look like this:
{
"user.name": "Alice",
"user.age": 30,
"user.address.city": "New York",
"tags.0": "javascript",
"tags.1": "php"
}
After unflattening, the same data is restored to:
{
"user": {
"name": "Alice",
"age": 30,
"address": {
"city": "New York"
}
},
"tags": ["javascript", "php"]
}
💡 Looking for premium JavaScript plugins and scripts? MonsterONE offers unlimited downloads of templates, UI kits, and developer assets — worth checking out.
Developers flatten JSON for several practical reasons. Environment variables, for instance, cannot represent nested structures — so a .env file or a CI/CD pipeline config often stores nested settings as DATABASE_HOST, DATABASE_PORT or using dot-notation like database.host. Similarly, some NoSQL databases, CSV exports, and flat-file storage systems require single-level key-value maps.
Redux DevTools, form serializers (like qs in Node.js), and certain API gateways also produce flattened output. When debugging or restoring this data, developers need a reliable way to reconstruct the original hierarchy — which is exactly what this tool does.
The algorithm parses each key by splitting it on the chosen delimiter. It then traverses the result object, creating nested objects along the path. For example, the key a.b.c with value 42 creates {"a": {"b": {"c": 42}}}. Conflicts — where a key path tries to set both a scalar and an object at the same node — are handled by preferring the deeper path.
After building the nested object, a second pass detects numeric keys. Any sub-object whose keys are all integers and form a contiguous sequence starting at 0 is automatically promoted to a JSON array. This correctly restores arrays that were flattened as items.0, items.1, etc.
Different tools and libraries use different delimiters when flattening JSON:
.) — The most common. Used by flat (npm), Python's flatten_json, and most configuration tools./) — Common in JSON Pointer (RFC 6901) and some REST API implementations._) — Used in some legacy systems and SQL column naming conventions (e.g. user_address_city).-) — Seen in certain YAML-to-flat-JSON export tools.|) and Colon (:) — Used in custom serializers where the key content may include dots or underscores.Environment variable restoration: When deploying applications, it is common to inject nested config as flat env vars (e.g. APP_DB_HOST or app.db.host). This tool lets you reconstruct the full config object for local development or debugging.
Database column expansion: Some ORMs or data pipelines serialize nested JSON fields as flat columns with underscores. This tool reverses that transformation for inspection or migration.
Form data reconstruction: Libraries like PHP's parse_str, Python's werkzeug, and Node's qs serialize nested form fields using bracket or dot notation. Unflattening restores the intended structure from these serialized payloads.
API debugging: When receiving webhook payloads or flat API responses, unflattening helps you quickly visualize the logical data hierarchy without writing custom parsing code.
Make sure your input is valid JSON — the tool validates this first and reports any parse errors with a clear message. If your keys contain the delimiter character as part of the key name itself (rather than as a hierarchy separator), switch to a less common delimiter like pipe or colon. For deeply nested structures, use the depth stat displayed after conversion to quickly understand how many levels deep the restored object goes. The tool also reports the total key count before and after unflattening, which helps verify the transformation is complete.