Skip to content

Flatten JSON

Flatten one nested JSON document into a flat map of key paths, with policy switches for arrays, empty containers and colliding keys, all bounded in advance.

JSONflattenText

Upload

Files (1–1)
One JSON document, up to 2 MB. A scalar document passes through unchanged.

Options

Questions people ask
What do the flattened keys look like?
The path from the document root joined with your separator: a record nested under data and user becomes data.user.name. Arrays under the indexed style append the element number, starting at 0, so the third row appears as rows.2. Choose the slash separator if dots already appear in your own key names.
What happens to empty objects and arrays?
Your choice. The default omits them from the output and counts them; emit keeps them verbatim, an empty object arriving as an empty object and an empty array as an empty array. Either way the count is in the result, so you know what the document held.
Are nulls preserved?
Yes. A JSON null stays a null in the output; it is never turned into a string, never turned into an empty expression of itself, and never dropped. The metadata reports how many nulls the document carried.
When do keys collide, and what then?
Collisions happen when two different source paths produce the same flat key, most often a key written with the separator in it sitting next to real nesting. The default refuses the run naming the key. The escape policy keeps the first claim on the key and disambiguates each later one with a deterministic escaped suffix, reporting how many collisions occurred.
How deep and how wide can my document be?
Bounded, and named rather than vague: 64 nesting levels and 20,000 output pairs. Deeper or wider documents are refused with a clear message telling you which bound tripped, so nothing runs away and no half answer is produced.
What happens to my files?
The upload is removed as soon as processing finishes; the flattened output stays downloadable for about 10 minutes, then it is deleted automatically.