JSON

JSON Flattener and Unflattener

Flattens nested JSON into single-level dotted keys, and rebuilds the nesting from them.

Loading the tool…

Processing happens locally in your browser. What you paste or load is processed by this page and is not uploaded to a server. Nothing is stored unless you use a control that says it stores something, and you can clear anything this site has kept from the privacy page.

How to use this tool

  1. Paste nested JSON to flatten it, or flat dotted keys to rebuild the nesting.
  2. Set the key separator if a dot would clash with your key names.
  3. Select Flatten or Unflatten.

What json flattener does

A lot of systems only accept flat key-value data: environment variables, feature flag stores, some configuration back ends, and most analytics event payloads. Flattening turns database.primary.host into a single key so that nested configuration can travel through them intact.

The round trip is the useful part. Flatten to move the data through a flat channel, then unflatten on the far side to get the original structure back. Array indices are preserved as bracketed segments so that lists survive the trip rather than becoming objects keyed by number.

Frequently asked questions

Array positions become bracketed path segments, so replicas[0] and replicas[1] are separate keys. That keeps lists distinguishable from objects keyed by number when you unflatten.

Yes, provided no original key contains the separator character. If your keys contain dots, change the separator to something they do not use before flattening.

To move nested configuration through a channel that only accepts flat key-value pairs — environment variables, feature flag stores and most analytics event payloads — and then rebuild the structure on the other side.