Skip to content
migration.tools
Nested JSON to Flat JSON

JSON flatten and unflatten tool

Flat key-value stores, spreadsheets, translation files and search indexes can't hold nested objects. Flatten JSON into dotted keys such as profile.address.city — and unflatten to get the original structure back.

Options

Nested JSON

Flat JSON

The result appears here as soon as there is input.

Processed on this device. Nothing you paste or drop is uploaded.

How to use it

  1. 1Paste your Nested JSON or drop a file onto the input panel.
  2. 2Adjust the options — the result updates as you type.
  3. 3Copy the Flat JSON or download it. Drop several files to convert a batch into one ZIP.

Round-tripping

Flattening joins each level with a dot and, optionally, indexes arrays (roles.0). Unflattening reverses it: dotted keys become nested objects, and objects whose keys are 0, 1, 2… become arrays again.

A top-level array of objects is flattened record by record, giving a list of flat objects ready to become table rows.

Questions

What if a key already contains a dot?

It will be treated as a level separator when unflattening. Rename such keys first if you need a faithful round trip.