Data & CSV

JSON Unflatten

Unflatten JSON

Turn flat dot-notation keys back into nested JSON objects and arrays.

About this tool

About JSON Unflatten

Flat key-value data is everywhere: spreadsheet columns named address.city, environment variables, translation files with keys like home.hero.title, form fields, and exports from analytics or search tools. Unflattening rebuilds the nested structure an API or application expects. Paste a flat JSON object and every key is split on the separator into a path; objects are created along the way, and numeric segments such as items.0.name or items[0].name become real arrays, so {"items.0.name":"Pen"} turns into {"items":[{"name":"Pen"}]}. Set a different separator, such as / or __, if your keys use one. If a top-level key is a number, the result is an array. Switch Mode back to Flatten to go the other way and click Use as input to check a round trip. The conversion runs entirely in your browser, so your data never leaves your device.

Built and maintained by Abhi JainUpdated

How to Unflatten JSON

  1. 1

    Paste flat JSON

    Paste a JSON object whose keys are paths, like {"user.name":"Ada"}, into the Flat JSON pane.

  2. 2

    Check the separator

    Set Separator to the character your keys use between levels. The default is a dot.

  3. 3

    Copy nested JSON

    Copy or download the Nested JSON. Switch Mode to Flatten to reverse it.

JSON Unflatten: questions and answers

How are arrays rebuilt?

A path segment that is a whole number, like the 0 in tags.0 or tags[0], becomes an array position. Other segments become object keys.

What separator should I use?

Use the one your keys were written with: a dot for user.name, double underscore for USER__NAME style environment variables, or a slash for path-like keys.

What if two keys conflict?

If a key such as a is a plain value and another key a.b needs it to be an object, the later key wins. Check the input for duplicates when the output looks wrong.

Is my data uploaded?

No. Everything happens in your browser.

More JSON Flatten presets