Simple online tools for developers, networking, text and conversions.

Developer Tools

JSON Unflatten

Expand flat path-based JSON into nested objects and arrays.

Tool

Use this JSON Unflatten tool to convert flat path-based JSON into a nested JSON structure again. It is useful when you receive flattened exports, mapping results, analytics-style path objects, or intermediate transformed data and want to rebuild the original nested shape. The tool supports dot notation for objects and bracket indexes for arrays.

About this tool

Use this JSON Unflatten tool to convert flat path-based JSON into a nested JSON structure again. It is useful when you receive flattened exports, mapping results, analytics-style path objects, or intermediate transformed data and want to rebuild the original nested shape. The tool supports dot notation for objects and bracket indexes for arrays.

Use json unflatten when you need a fast browser-based result without extra setup. It works well for quick checks, one-off tasks, and routine formatting or calculation work.

Learn more

Why use this tool

How to use

  1. Paste a flat JSON object into the input box
  2. Use keys like user.id or orders[0].id in the input
  3. Click Run Tool to rebuild the nested structure
  4. Review the nested JSON output
  5. Copy the result for reuse, testing, or documentation

Examples

Example

Input

{"user.id":7,"user.name":"Anna"}

Output

{
  "user": {
    "id": 7,
    "name": "Anna"
  }
}

Useful when flat dot-notation keys need to become a normal nested object again.

Example

Input

{"orders[0].id":101,"orders[1].id":102}

Output

{
  "orders": [
    {
      "id": 101
    },
    {
      "id": 102
    }
  ]
}

Useful when flattened array paths need to be restored into array items.

Common errors

The input is not a flat JSON object

Fix: Use a JSON object with string keys like user.id or items[0].name.

Path notation is inconsistent

Fix: Use dot notation for objects and bracket indexes for arrays.

The JSON input is invalid

Fix: Validate or format the input first before unflattening.

Conflicting keys try to assign incompatible structures

Fix: Avoid mixing paths that force the same field to be both a primitive value and a nested object.

The user expects original key order to be preserved

Fix: This tool rebuilds structure, but exact ordering may differ.

FAQ

What does JSON Unflatten do?

It converts a flat object with path-based keys into a nested JSON structure.

Does it support arrays?

Yes. Keys like items[0].name are restored into arrays with indexed objects.

What input format should I use?

Use a JSON object where each key is a path such as user.name or orders[0].id.

What is the difference between JSON Unflatten and JSON Flatten?

Flatten turns nested JSON into path-based keys, while Unflatten does the reverse.

Why did my output structure look wrong?

The most common reasons are conflicting paths, invalid JSON, or inconsistent key notation.

Use cases

Related tools