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
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.
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.
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
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.
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- JSON Flattener
Flatten nested JSON into a single-level object with dot or underscore keys.
- JSON Editor
Write, edit, format, minify, and validate JSON in a fast full-screen or embedded editor.
- JSON Escape & Unescape
Escape or unescape strings for code, logs, and API payloads.
- JSON Formatter & Beautifier
Format, prettify, and beautify messy JSON with configurable indentation and key sorting.
- JSON Key Sorter
Sort object keys alphabetically — recursively for stable, readable JSON.
- JSON Merge Tool
Deep-merge two JSON objects — nested keys combine, arrays and scalars override.