Files and data

JSON flatten and unflatten

Flatten JSON into reversible JSON Pointer paths while preserving arrays, empty containers and data types.

Runs on your device · No upload

UTF-8 text up to 5 MiB, 100 nesting levels and 100,000 nodes. Restoration requires parent records before their children and consecutive array indices.

Ready when JavaScript is loaded.

How to use it

  1. Paste JSON or choose a UTF-8 JSON file.
  2. Flatten into the typed JSON Pointer format, or restore a document previously created here.
  3. Copy or download the result and inspect the path/type records.

Paths that do not collide

Dotted-key maps can confuse a literal key such as "a.b" with an object inside a. This tool uses JSON Pointer: slash separates path segments, ~1 represents a literal slash, and ~0 represents a literal tilde. The empty pointer identifies the root.

Container types are part of the export

Each node records whether it is an object, array or scalar value. Empty objects, empty arrays, null, numeric object keys and nested arrays remain distinct. Restoration requires this typed format; an arbitrary dotted-key object is not enough to recover those distinctions.

Object key order and whitespace are presentation details and can change. Duplicate source keys and numbers that would change during serialization are rejected.

Standards and references

Your input stays in this tab

Files and pasted values are processed in your browser. They are not uploaded, stored in your URL or saved to browser storage. Download the result if you want to keep it. CSV exports are limited to 1,000,000 cells and 20 MiB; large or sparse tables must be split. The site records aggregate page requests as described in the privacy policy.

More tools

Browse every tool