JSON basics
What does it mean to flatten JSON?
Flattening converts a nested object into a single-level object. Each output key records the route to its original value, such as user.profile.name or items[0].sku.
Flat paths are useful for spreadsheets, translations, environment-style settings, logs, and systems that cannot accept nested objects. Unflattening rebuilds the nested structure when the path notation is unambiguous.
user.name{"user":{"name":"Ada"}}
→
{"user.name":"Ada"}Workbench
Flatten, reverse, or extract one view
The same parser powers every mode, so arrays, empty containers, booleans, numbers, strings, and null values stay typed.
Bracketed array indices preserve arrays during unflattening.
Choose dot, slash, underscore, double underscore, or a custom separator.
Switch the result to paths, keys, or primitive values without creating separate tools.
Keep deeper objects intact when only the first few levels need flattening.
Workflow
How to flatten or unflatten JSON
- 1Add JSON
Paste data, open a file, or load the sample.
- 2Choose the direction
Use Flatten for nested input or Unflatten for an object whose keys contain paths.
- 3Set path rules
Pick a delimiter, array notation, and optional maximum depth.
- 4Review and reuse
Inspect JSON, paths, keys, or values, then copy, download, or move the result back to the input.
Processing is local. The tool does not place your JSON in the page URL or send it to a conversion service.
Accuracy
Path collisions and other limits
Delimiter inside a key
A key such as first.name is ambiguous when dot is the delimiter. Choose a separator that does not occur in your keys.
Numeric object keys
A numeric segment can look like an array index. Bracket notation is the safest choice when arrays must round-trip.
Maximum depth
Values below the limit remain nested JSON values rather than being converted to text.
Common questions
JSON flattening questions
Does flattening change value types?
No. JSON strings, numbers, booleans, nulls, arrays, and objects remain JSON values.
Can I flatten arrays?
Yes. Choose bracket indices such as items[0] or delimiter indices such as items.0.
Can every flat object be unflattened?
No. Conflicting paths and keys containing the selected delimiter can be ambiguous. The tool reports collisions instead of silently overwriting data.
What is the difference between paths and keys?
Paths include the full location of leaf values. Keys lists object property names encountered anywhere in the document.