Code tool

JSON Flatten and Unflatten

Flatten a JSON value to a reversible list of paths, or restore a list produced by this tool. Processing stays in your browser.

In-browser processingNo account requiredPrivacy details ↗

Standard JSON, up to 2 MB.

Paths use JSON Pointer escaping: ~ becomes ~0 and / becomes ~1. Container types are included so arrays, numeric object keys, and empty containers round-trip without guessing.

Paste JSON to begin.

A QUICK WALKTHROUGH

How to use this tool

  1. Paste standard JSON up to 2 MB and choose Flatten JSON or Unflatten path records.
  2. Convert and review the typed JSON Pointer records or reconstructed JSON.
  3. Copy the result or download it as a JSON file.

A documented reversible format

Flattening creates a JSON document with the format identifier hello-keyboard.flat-json.v1 and one record per container or scalar. Each record has a JSON Pointer path and an explicit JSON type. Objects, arrays, empty containers, numeric object keys, and root scalar values therefore remain distinguishable.

JSON Pointer paths

Paths use slash-separated JSON Pointer segments. A tilde in an object key becomes ~0 and a slash becomes ~1. Array indexes start at zero and must be contiguous when restoring. The tool rejects duplicate paths, missing parents, invalid escapes, incompatible types, and malformed arrays instead of silently changing data.

Local input limits

Standard JSON up to 2 MB is parsed in this browser. Comments, trailing commas, NaN, and Infinity are not valid JSON. Nothing is uploaded, and no external library is required.

GOOD TO KNOW

Common questions

Can I restore the flattened output?

Yes. Choose Unflatten path records and paste the complete document produced by this tool. The format identifier and explicit type records let it rebuild arrays, objects, empty containers, and scalar roots.

Which path syntax is used?

JSON Pointer escaping is used: ~ becomes ~0 and / becomes ~1 inside a key. The empty path identifies the root value.

Can I unflatten records from another tool?

Only if they use the hello-keyboard.flat-json.v1 document shape with typed entries. Other flattening formats can use different path separators and array rules.

Is the input uploaded?

No. Parsing, flattening, unflattening, copying, and download preparation happen locally in your browser.