JSON Flatten / Unflatten

Flatten nested JSON into dot-notation keys, or rebuild nested JSON from flat keys. Runs entirely in your browser.

About this tool

Flattening turns nested objects and arrays into a single-level object with dot-notation keys, e.g. a.b and a.c.0 — useful for spreadsheets, environment variables, or diffing deeply nested structures. Unflatten reverses this: keys whose next segment is a number become array indices, otherwise an object.

Share on LinkedInShare on X
Link to this tool

Copy this HTML to cite this tool from your own site or article.

About JSON Flatten / Unflatten

JSON Flatten / Unflatten flattens nested JSON objects into single-level dot-notation keys or rebuilds nested JSON structures from dot-notation keys.

How to use JSON Flatten / Unflatten

  1. Paste nested JSON object into input editor.
  2. Select operation mode: Flatten or Unflatten.
  3. Click Process JSON to execute object structural transformation.
  4. Copy transformed JSON payload.

Examples

Nested Input: {"user":{"name":"Alice"}} Flattened Output: {"user.name": "Alice"}

FAQ

Can I customize the dot separator character?

Yes. You can select dots (.), underscores (_), or custom delimiter characters for flattened keys.

How are array indexes represented when flattened?

Arrays use bracketed or dot-indexed key paths (e.g. items[0].id or items.0.id).