Skip to content

Unflatten JSON

Restore nested JSON from explicit path records and explore the reconstructed structure.

Source
Restored structure
5Values
2Depth
objectRoot type
Explore the document
Restored value preview
{
  "user": {
    "name": "Ada"
  },
  "tags": [],
  "empty": {}
}

Select branches to inspect the restored data. Export always saves the complete restored document.

Processed on your device

How it works & useful details

How it works

Restore records produced by JSON flatten. Include an empty-path root record and explicit parent containers. Value records need a primitive value; container records have only path and kind. Duplicate paths, missing parents, sparse arrays and invalid escapes are rejected. Record order may vary. Up to 10,000 records.

Limits & privacy

Up to 1,000,000 characters, 50,000 values and 64 levels. Live previews pause above 40,000 characters; run the tool to process the full supported input. Imported files must be UTF-8 and under 1 MB. Your data stays on this device.

Numbers use JavaScript decimal precision. Unsupported large integers are rejected; quote identifiers to keep all digits. Duplicate object names keep their last value. Transforms preserve data, not source whitespace or number spelling.

Paths use JSON Pointer: an empty path selects the root, ~0 escapes a tilde, and ~1 escapes a slash.

About this tool

Unflatten JSON restores a nested structure from the explicit path records produced by the Flatten tool. It is the second half of a round trip that keeps data table-friendly without losing the original shape.

The reconstruction validates that paths do not conflict and that no value is silently overwritten. The rebuilt document is rendered locally so you can compare it with the original.

How to use it

  1. Paste the path records, one per line.
  2. Run the unflatten operation.
  3. Review the restored structure in the tree preview.
  4. Copy or download the nested JSON.

Worked example

These records

[
  {"path": "", "kind": "object"},
  {"path": "/user", "kind": "object"},
  {"path": "/user/name", "kind": "value", "value": "Ada"},
  {"path": "/user/tags", "kind": "array"},
  {"path": "/user/tags/0", "kind": "value", "value": "x"}
]

rebuild {"user":{"name":"Ada","tags":["x"]}}. The explicit array record is what tells the tool that /user/tags is an array and not an object with a key named "0".

Round-tripping edited data

A typical workflow is: flatten a document, edit the values in a spreadsheet or with a script, then unflatten the result. Because the records carry explicit container kinds, the rebuilt JSON has the same shape as the original.

The tool refuses input that would be ambiguous or lossy: two records with the same path, a value whose parent container is missing, or an array with gaps such as indexes 0 and 2 without 1. Rejecting these catches editing mistakes instead of silently producing a different structure. Records can be in any order.

Frequently asked questions

What happens if two records conflict?

Conflicting paths, such as one value being both a scalar and an object, are rejected with the line that caused the problem.

Which path syntax is accepted?

JSON Pointer paths, matching the output of the Flatten tool.

What is the limit?

Up to 1,000,000 characters, 50,000 values, and 64 levels of nesting.

Can I unflatten dot-notation keys like a.b.c?

No. The input must use the path-record format produced by JSON flatten, with JSON Pointer paths and kind markers.