JSON Flatten & Unflatten

Convert nested JSON hierarchies into simple key-value maps (using dots) and back again.

100% Client-Side (No data leaves your device)
Input JSON Workspace 0 chars
1
Conversion Output
1
Outputs will appear here...

User Guide: Flattening and Unflattening JSON

What is JSON Flattening?

JSON objects contain nested sub-objects and key directories. Databases like DynamoDB or flat configuration tables inside application environments often require parameters declared at a single root level. Flattening converts hierarchical structures to single-level maps using separators (like dot-notation user.address.zip).

Step-by-Step Instructions

  1. Paste JSON: Enter your nested structure inside the Input workspace.
  2. Set Mode & Separator: Select Flatten mode and pick dot, slash, or underscore as the separator.
  3. Execute: Click Process Conversion. The output instantly reflects flat keys.
  4. Reverse Process: Select Unflatten mode, paste a dot-notation structure, and convert it back to a standard nested hierarchy.

Preserve Arrays Feature

By default, checking "Preserve Arrays" keeps lists like "tags": ["web", "api"] intact as standard array declarations. If you uncheck this option, arrays are flattened into separate indexes, producing flat keys like tags.0 = "web" and tags.1 = "api".

Before & After Flattening Example

Original Nested Input:
{
  "user": {
    "profile": { "name": "Sarah" }
  }
}
Flattened Dot Notation Output:
{
  "user.profile.name": "Sarah"
}