JSON Flatten / Unflatten
Flatten turns a nested document into a single level object whose keys are paths, like config.db.host or users[0].name, which suits spreadsheets, environment config, and diffs. Unflatten rebuilds the nested document from those paths.
JSON
Result
Result will appear hereReady. Press Run or Ctrl+Enter.
How to use the JSON Flatten / Unflatten
- Choose Flatten or Unflatten.
- Paste the document.
- Run the tool and copy the result.
Example
Flatten produces keys such as author.name and tags[0].
{
"name": "json-utils",
"version": "1.0.0",
"private": false,
"tags": ["json", "tools"],
"author": { "name": "Ada", "active": true },
"score": 9.5,
"notes": null
}Frequently asked questions
Is flattening lossless?
Yes for documents whose keys do not themselves contain dots or brackets. Keys containing those characters can make unflatten ambiguous, and the tool cannot detect every such case.
What happens to empty objects?
Empty objects and arrays are kept as leaf values so no key silently disappears.