How to use the Flatten Nested JSON
- 1 Drop or paste the JSON on the studio, or try the example.
- 2 Check the flattened result in the preview. Change the separator or the array rule if you need to.
- 3 To go back, add “Rebuild nested JSON” after it – the result should equal your original.
- 4 Copy or download the JSON.
Flat JSON is still JSON
Some systems – environment-style config, translation files, search indexes, form builders – want every value on one level: address.city instead of {"address": {"city": …}}. This step does that for any JSON document. If the document is a list, each item is flattened on its own.
Unlike converting to a table, the result stays JSON, so numbers stay numbers, true stays true and null stays null. Nothing becomes text.
Rules you control
- Separator: a dot by default; use a slash, underscore or anything else.
- Arrays: number the items (
tags.0,tags.1) or keep each list as one JSON text value. - Depth: stop flattening at a depth; everything deeper is kept as JSON text and counted in the notes.
- Empty objects and lists are kept as they are, so they don’t disappear.
And back
“Rebuild nested JSON” splits keys at the separator and rebuilds objects, and optionally lists from keys numbered 0, 1, 2 …. Two keys that disagree – a as a value and a.b as a child – cannot both exist; the studio keeps the first and reports the conflicts.
If you want a table with columns rather than JSON, see convert JSON to CSV. The JSON syntax follows RFC 8259.
Limits
A key that itself contains the separator makes the round trip ambiguous – choose a separator that does not occur in your keys.
Frequently asked questions
Is the flattening reversible?
Yes, with “Rebuild nested JSON” and the same separator, as long as no key contains the separator itself and you flattened arrays as numbered keys.
What happens to arrays?
By default their items are numbered: tags.0, tags.1. You can keep a whole array as JSON text instead.
Does this change number formats?
No. Numbers keep their exact text, including trailing zeros and very long digits.
Last updated: