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

Developer Tools

JSON Unflatten Examples

Review practical JSON Unflatten examples so you can understand expected input, output, and common patterns faster.

Why examples matter for JSON Unflatten

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.

Example pages are especially useful for developer tools because they show what good input looks like, what kind of output to expect, and how the tool behaves in common scenarios.

JSON Unflatten examples

Unflatten a simple object

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.

Unflatten array paths

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.

How to use these examples

  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

Common mistakes in sample input

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.

Next steps

After reviewing these examples, run the live tool with your own input. If your task involves a follow-up step, the related page can help you move to the next tool in the workflow.

Run the main tool

Open the main JSON Unflatten page and test your own real input.

Open JSON Unflatten