JSON FlattenerONLINE

Turn nested JSON into a flat map of bracket paths and leaf values.

1 MiB per input · Ctrl / ⌘ + Enter to run

Paths use $ with quoted property names and numeric array indexes, avoiding ambiguity when a key contains a dot or bracket.

Result
Ready. Paste input, then run the tool.
Your JSON stays in your browser. Core processing happens locally.
THE PRACTICAL GUIDE

Flatten nested JSON into explicit paths and values

Flatten converts nested leaves into a map whose keys are full JSON paths. Quoted bracket paths distinguish a literal dot in a name from a navigation separator.

When should you use it?

  • Inspect all leaf values in a nested configuration.
  • Prepare path/value pairs for mapping work.
  • Compare fields across structures with explicit locations.
WORKED EXAMPLE

Example: name each leaf by its path

Quoted brackets distinguish property names from array indexes and allow special characters in keys.

Nested JSON
{"user":{"name":"Alex"}}
Flat mapping
{"$[\"user\"][\"name\"]":"Alex"}

Keep path syntax separate from property text

A dotted key such as user.name can be confused with a nested user object. This tool writes quoted bracket paths beginning at $, with numeric segments for array indexes. That makes a literal dot in a property name distinguishable from a structural boundary. Leaf values are attached to their full locations; empty containers are retained so their existence is not lost.

Choose flattening for inspection or a defined interchange

A path map is useful for comparing nested fields, reviewing configuration overrides, or documenting where values live. It is not automatically the flat row format expected by a CSV consumer. Use the matching Unflatten tool to rebuild this path notation. If another system expects dotted names or a different array convention, define that mapping explicitly before importing the result.

IN PRACTICE

How do I flatten nested JSON without confusing dots in key names?

The flattener names each leaf with a root-based bracket path. A property called a.b is represented as one quoted member, while nested a then b produces two bracket segments. That distinction matters when a path/value export must be reversed later.

Two different shapes produce different paths

text
{"a.b":1}      → $["a.b"]
{"a":{"b":1}}  → $["a"]["b"]

Empty arrays and objects also get path entries so a round trip can keep their presence.

Only if that tool understands this exact $ bracket format. Dot notation commonly treats dots in property names as separators and may produce a different structure.

BEFORE YOU USE THE RESULT

What should you check before using the result?

The path map is a transport shape for this site’s notation, not a generic dot-path format. Review consumers that expect other flatten conventions.

Understand JSON paths

Technical reference: JSON syntax and interoperability · RFC 8259

THE JSON FIELD GUIDE
All guides