About this tool: Flatten and Restore JSON
Flatten nested JSON into JSON Pointer paths and restore arrays, objects and empty containers without losing their types.
The flat format contains two maps: containers records each object or array, and values stores scalar leaves under escaped JSON Pointer paths. This preserves empty arrays, empty objects and numeric object keys. Paste that complete format into restore mode to recover the original JSON.
Worked example
| Input | {"user":{"name":"Ada"},"tags":["web"],"empty":{}} |
| Mode | Flatten |
{"containers":{"":"object","/user":"object","/tags":"array","/empty":"object"},"values":{"/user/name":"Ada","/tags/0":"web"}}Questions and answers
What does this tool do?
Flatten nested JSON into JSON Pointer paths and restore arrays, objects and empty containers without losing their types. The flat format contains two maps: containers records each object or array, and values stores scalar leaves under escaped JSON Pointer paths. This preserves empty arrays, empty objects and numeric object keys. Paste that complete format into restore mode to recover the original JSON.
What affects precision and input format?
The flat format contains two maps: containers records each object or array, and values stores scalar leaves under escaped JSON Pointer paths.
Where are the calculations performed?
The calculation runs in your browser. You can use the tool without installing software.
Comments (0)
Share your thoughts — please be polite and stay on topic.
Log in to comment