JSON Flatten — Nested to Dot Notation

Turn a deeply nested object into flat dot-notation keys, the shape config loaders, feature flags and spreadsheets all expect.

Output

How to use

  1. Paste the nested JSON document.
  2. The dot-notation version appears alongside.
  3. Copy the flattened keys.

Frequently asked questions

What does the flattened form look like?

One key per leaf value, joined with dots: a.b.c rather than three levels of nesting. Arrays get numeric segments, so items.0.name.

What is it useful for?

Config systems, feature flag stores and spreadsheets all want flat key-value pairs. So does a diff, since flat keys make it obvious which leaf changed.

Can I go back to nested?

The mapping is reversible as long as no key contains a literal dot. Keys with dots in them are the one case where the round trip is ambiguous.

How are empty objects handled?

An empty object or array has no leaves, so it produces no keys. That is worth knowing if you flatten, edit and expect to rebuild the exact original.

Last updated

Powered by maratool