Skip to content

JSON

JSON Flattener & Unflattener

Convert nested JSON objects to a reversible JSON Pointer map and restore the nested structure without losing arrays.

How to use this tool
  1. Choose flattening or restoring nested JSON.
  2. Paste a JSON value or an object mapping pointer paths to values.
  3. Transform and review the JSON output.

Loading tool…

Find this tool in

About this tool

What is JSON Flattener & Unflattener?

Turn nested JSON objects into a path-to-value map for inspection, then reconstruct the object with the matching reverse operation. This tool uses JSON Pointer paths rather than dotted property names. Arrays remain complete values, which avoids guessing whether a numeric-looking object key represents an array index.

A worked example

Flatten a nested object with an escaped property name

Example input

{"user":{"a/b":2}}

Expected result

{
  "/user/a~1b": 2
}

Flatten the object. The slash inside the property name becomes ~1, while the slashes between path segments describe nesting. Unflattening this map restores the original property name and numeric value. A literal tilde is escaped as ~0, so paths must be decoded with the same mapping.

Common mistakes and limits

  • Do not substitute dot notation for JSON Pointer. A property containing a dot is not automatically another nesting level.
  • Root and child paths cannot be combined ambiguously. Resolve conflicting paths instead of assuming one value will silently win.

Features

What you can do

  • Object paths escaped according to JSON Pointer rules
  • Round trips preserving arrays and empty containers
  • Parent/child conflict detection and bounded nesting

Frequently asked questions

Questions about JSON Flattener & Unflattener

What should I know before using JSON Flattener & Unflattener?

Uses JSON Pointer paths, not dot notation or JSONPath. Arrays are preserved as whole values. Root values use the empty path. Limits are 1 million characters, 10,000 values and 32 levels. Conflicting paths are rejected; this is a data transformation, not a schema validator.

Related tools