JSON Flatten & Unflatten
Convert nested JSON objects to dot and bracket paths or rebuild them locally, preserving empty containers and refusing collisions, array gaps and unsafe numbers.
Switching modes keeps the original JSON and clears results. Data stays in this page’s memory: no upload, storage or URL payload. Leaving or reloading clears it. Each mode keeps its parsing limits.
Enabling local controls…
1. Input and convert
Processed only in browser memory. No upload, storage or URL state.
By default the root must be an object; object keys use dots and array indices use [0], allowing reconstruction. Dot indices also accept a root array but cannot distinguish numeric object keys from array indices, so this format is flatten-only; an empty root array is retained at the empty path. Object keys must be nonempty, cannot contain . [ ], and cannot be __proto__, constructor or prototype. Empty containers are preserved.
UTF-8 source: Flatten up to 1 MiB, Unflatten up to 8 MiB. Current limit: 1 MiB. Up to 100 levels, 50,000 nodes; each path up to 4,096 UTF-8 bytes; complete output up to 8 MiB. Work stops after 5 seconds. Failure produces no partial result.
Paste text or choose a local file. Files use strict UTF-8 decoding; invalid UTF-8 and BOM are rejected. The original file is never overwritten.
2. Inspect and export
Enter root object JSON or load a sample, then run the conversion.
How to use this tool
Paste root-object JSON or choose a strict UTF-8 file, select Flatten or Unflatten and convert. Review paginated paths, types and values, then copy or download complete compact JSON. Switching JSON modes keeps the source and clears results.
When not to use it
The default dot/bracket convention supports reconstruction. Optional dot-index flattening also accepts root arrays, but cannot distinguish numeric object keys from array indexes and cannot be reconstructed. Empty or delimiter-containing keys, prototype-related segments, sparse arrays and conflicting paths are rejected. Semantic round trips do not preserve formatting or number spelling.
Read the guide →