JSON Flatten / Unflatten

Flatten nested JSON into deterministic path keys, or rebuild nested JSON from path-keyed objects.

Browser-local

JSON input

Nested or flat JSON object

Flattened output

Flattened or rebuilt JSON output

{
  "user.name": "Ada",
  "user.roles.0": "admin",
  "user.roles.1": "qa"
}

How JSON flattening works

Paste a nested JSON object to flatten it into path keys for spreadsheets, logs, query outputs, or diff-friendly review. Switch to unflatten mode to rebuild nested objects and arrays from those path keys.

Use cases

Developers use JSON flatten tools for data exports, analytics checks, API fixture normalization, logging pipelines, and reviewing nested payloads where deep structures are hard to scan.

Safety and limits

The unflatten path builder rejects prototype-pollution keys and reports invalid JSON instead of mutating unsafe object paths. It does not infer business schema types or merge conflicting paths.

JSON flatten questions

What does flattening JSON do?
It turns nested object and array values into path-keyed fields such as user.roles.0.
Can I rebuild nested JSON?
Yes. The unflatten mode turns flat path keys back into nested objects and arrays.
Is unflattening safe?
Prototype-related keys such as __proto__, constructor, and prototype are rejected to avoid unsafe object mutation patterns.

What this JSON Flatten does

Use this JSON flatten and unflatten tool to convert nested JSON into path-keyed fields, then rebuild nested objects when needed. It is useful for logs, spreadsheets, analytics exports, fixture normalization, and diff-friendly payload inspection.

When developers use it

  • Flatten deeply nested API responses into simple key/value paths for review or export.
  • Unflatten path-keyed JSON from logs, query outputs, or spreadsheets back into nested objects.
  • Normalize payloads before sorting, comparing, or sharing small fixtures locally.

Privacy, input, and output

Flattening and unflattening happen in browser memory only. PayloadHarbor does not upload nested objects or flattened fields.

Paste valid JSON and choose Flatten JSON or Unflatten JSON. The tool uses a configurable separator and returns formatted JSON with copy and download controls.

Validation rules and limitations

  • Unflatten mode rejects unsafe path segments such as __proto__, prototype, and constructor.
  • The transformer does not resolve conflicting path assignments or infer schema meaning from flattened keys.