Back to Free Tools

FREE TOOLS

JSON Flatten and Unflatten

Flatten JSON into reversible typed path entries and restore the same explicit format without losing empty containers or exact numbers.

JSON, dth-json-flat-v1 JSON

dth-json-flat-v1 JSON, JSON

Browser only

Runs locally in your browser. Your files, pasted content and generated output are not uploaded. Reset clears this tool’s working data.

This tool needs JavaScript. If it does not load, refresh the page and try again.

How to use this tool

  • Choose Flatten JSON to path entries or Restore JSON from path entries.
  • Paste JSON or select one UTF-8 file; the file takes precedence.
  • Select Transform JSON and download flattened.json or restored.json.
  • For restoration, use this tool's explicit format with an empty root path first, parent containers before children and contiguous array indexes.

Examples

{"a/b":{"~key":[]}} becomes typed entries with paths "", "/a~1b" and "/a~1b/~0key"; restoring preserves the empty array.

Limitations

  • Input and flat output: 5 MiB UTF-8; up to 25,000 entries, 40 nesting levels and the shared 200,000-value JSON parsing bound. Restored JSON remains subject to the shared 20 MiB output bound.
  • This uses the explicit dth-json-flat-v1 envelope, not a generic dot-key object or an interoperability guarantee with other flattening tools.
  • Paths use ~0 for tilde and ~1 for slash. Explicit kinds distinguish arrays from objects and preserve empty containers; exact scalar number tokens are retained.
  • Duplicate keys or paths, conflicting parents, children of scalar values, invalid pointer escapes and sparse or out-of-order arrays are rejected. Formatting whitespace is regenerated.

Related tools

No items found.

More tools for your workflow

Explore the related desktop tool