JSON Unflattener

Reverse JSON flattening by converting dot-notation flat keys back into nested objects and arrays. Supports custom delimiters and automatic array detection from numeric keys.

Flat JSON Input
Nested JSON

Features

๐Ÿ”€ Reverse Flattening

  • Converts dot-notation keys to nested objects
  • Restores original JSON hierarchy
  • Handles deeply nested structures
  • Preserves all value types

๐Ÿ“‹ Array Detection

  • Auto-detects numeric keys as array indices
  • Reconstructs ordered arrays correctly
  • Optional โ€” can be disabled
  • Works with mixed object/array structures

โš™๏ธ Flexible Delimiters

  • Dot (.) โ€” most common default
  • Underscore (_) โ€” common in env vars
  • Slash (/) โ€” URL-path style keys
  • Custom delimiter for any format

JSON Unflatten Guide

How Unflattening Works

Flat JSON uses dot-separated keys to represent hierarchy. This tool splits each key on the delimiter and rebuilds the nested structure.

// Input (flat)
{
  "user.name": "Alice",
  "user.age": 30,
  "tags.0": "js",
  "tags.1": "go"
}

// Output (nested)
{
  "user": { "name": "Alice", "age": 30 },
  "tags": ["js", "go"]
}