Skip to content

JSON Unflattener

Rebuild nested JSON from flat dot-notation or bracket-notation keys.

Bracket notation is understood automatically, whatever this is set to.

Quick Tool Overview

The JSON Unflattener rebuilds nested JSON from a flat object of path keys. Numeric path segments become array indexes and everything else becomes an object key, and it reads dot notation, bracket notation or a mixture of the two.

What it does
Expands flat path keys back into nested JSON
You give it
A single-level object keyed by paths
You get back
A properly nested document with real arrays
Best for
Turning env files, form posts and spreadsheet rows into API payloads
Developer Tools Free, unlimited use No sign-up Runs in your browser

About the JSON Unflattener

Unflattening is the inverse of flattening: a single-level object whose keys are paths becomes a properly nested document. The key "user.address.city" creates the objects it names, and a numeric segment such as "items.0.sku" creates an array rather than an object.

It is the step that turns machine-friendly storage back into something an API will accept. Flat keys are how environment files, spreadsheet columns, form posts and key-value stores hold structured data, and every one of those eventually has to be sent somewhere that expects real nesting. The parser accepts dot notation, bracket notation and a document that mixes the two, which hand-edited config files frequently do.

Key features of the JSON Unflattener

Arrays are rebuilt, not faked

A numeric path segment produces a real array, so items.0.sku comes back as a list of objects rather than an object with "0" as a key.

Reads both notations

Dot and bracket keys are both understood, including a document that mixes them — which hand-edited config files routinely do.

A configurable separator

Match whatever character your keys were joined with, so the round trip through the Flattener is lossless.

Deep nesting is fine

Paths of any length rebuild correctly; the structure is created level by level as each key is read.

Formatted output

The rebuilt document is indented and ready to send, not returned as one line.

How to use the JSON Unflattener

  1. 1

    Paste the flat JSON

    A single-level object whose keys are paths, in dot or bracket notation.

  2. 2

    Set the separator

    Leave it as a dot, or change it if your keys are joined with underscores or slashes.

  3. 3

    Check the nesting

    Numeric segments become array indexes; everything else becomes an object key.

  4. 4

    Copy the result

    The nested document is formatted and ready to send.

Frequently asked questions

By the path segment. A segment made only of digits creates an array index; anything else creates an object key. So items.0.sku produces an array of objects.

Reviews of the JSON Unflattener

What people who use the JSON Unflattener think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the JSON Unflattener. It takes half a minute and no account.

Write the first review

More developer tools