JSON Flatten and Unflatten
Convert nested JSON into dot-notation keys and rebuild nested objects from flat data.
Input
Result
How to use
Flatten nested JSON
Paste nested JSON and run Flatten. Arrays become numeric keys, for example user.roles.0.
- Paste nested JSON.
- Click Flatten.
- Copy the flat JSON output.
Unflatten key paths
Paste a flat object and run Unflatten. Numeric path segments are converted back into arrays automatically.
Frequently asked questions
How are arrays represented?
By default each array element gets a numeric segment, such as items.0.name. Empty arrays and objects are preserved as values.
Can I use a different separator?
The UI uses a dot separator. For custom separators, use the underlying library behavior in your own code.
Related tools
JSON Formatter
Beautify and validate JSON with configurable indentation, error highlighting and one click copy.
JSON Viewer
Read JSON in a clean formatted view and explore it as a collapsible tree.
JSONPath Tester
Query JSON data with JSONPath expressions and see matching values instantly.
JSON Validator
Check whether your JSON is valid and see a clear explanation of any syntax problem.
JSON Minifier
Remove every unnecessary space and newline to produce the smallest possible JSON payload.
JSON Tree Viewer
Turn JSON into an interactive, collapsible tree with array lengths and value types.