JSON Unflatten

Restore nested JSON from flat dot- or underscore-keyed objects.

  • 100% client-side · your data never leaves your browser
  • Instant, no rate limits
  • Free, no sign-up
Input JSON
Nested JSON

Your result appears here

Paste JSON into the panel on the left — everything runs privately in your browser.

Overview

JSON Unflatten — Restore Nested JSON from Flat Keys

Reverse flattening: turn dot- or underscore-separated keys back into nested JSON objects and arrays. Essential after CSV-to-JSON pipelines, analytics exports, and flat key-value stores when you need hierarchical structure again. Choose dot (user.name) or underscore (user_name) separators to match your source data.

No uploadsNo sign-upOpen source
  1. Unflatten vs flatten

    Flattening collapses nesting into single-level keys. Unflattening rebuilds trees from those keys. Array indices in paths (items.0.title) become array elements at the correct positions.

  2. Common use cases

    • Restore nested API shapes from flattened log fields
    • Convert spreadsheet or CSV-derived JSON back to document form
    • Round-trip testing with the JSON Flattener tool
    • Prepare nested configs for viewers and formatters
  3. How array indices are rebuilt

    Numeric segments in a path are treated as array positions, so items.0.title and items.1.title rebuild an items array with two objects in the right order. Non-numeric segments become object keys. This lets a fully flattened export — including lists — round-trip back to its original nested shape.

  4. After CSV and analytics pipelines

    Flat key-value data is convenient for spreadsheets, columnar stores, and log fields, but application code usually wants nested objects. Unflattening is the last step of a CSV-to-JSON or analytics-export pipeline: convert rows to flat JSON, then rebuild the hierarchy your API or UI expects.

FAQ

Frequently asked questions

How do I convert flat JSON to nested JSON?

Paste your flat object and choose the separator your keys use (dot or underscore); JsonDrift rebuilds the nested objects and arrays.

Which separator should I use?

Match your flat keys: user.address.city needs dot mode; user_address_city needs underscore mode.

Does it handle array indices?

Yes. Numeric path segments like items.0 create or extend arrays at that index.

Is this the reverse of flattening?

Yes. It undoes the JSON Flattener, so you can round-trip nested JSON to flat keys and back.

Continue with a related tool

All tools

Learn more in our guides

All guides