JSON Flatten & Unflatten

Flatten nested JSON into single-level dot-notation keys — or rebuild nested JSON from flat keys.

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.

Result

  

About this tool

Nested JSON is great for structure but painful for spreadsheets, form data, environment configs and diffing. This tool flattens any JSON document into a single-level object with dot-notation keys — and reverses the process just as easily.

Choose your own delimiter and switch to [0]-style array indexes when you need round-trip safety with keys that contain dots.

How to use it

  1. Pick a mode: Flatten or Unflatten.
  2. Paste your JSON (nested for flatten, flat key/value pairs for unflatten).
  3. Adjust the delimiter if your keys contain dots.
  4. Copy or download the result as JSON.

Useful ways to apply it

  • Preparing nested API data for CSV export or spreadsheets.
  • Converting config files between nested and flat (.env-style) shapes.
  • Diffing two JSON documents line-by-line after flattening.
  • Building form field names like address.city from an object.

Frequently asked questions

How are arrays handled?
Array elements become numeric segments: {"tags":["a"]} flattens to "tags.0": "a" (or tags[0] with the bracket option). Unflatten detects numeric segments and rebuilds real arrays.
What if my keys contain dots?
Switch the delimiter to something not used in your keys (like | or /), or enable bracket-style array indexes to reduce ambiguity.
Is there a depth limit?
No fixed limit — any depth your browser can parse will flatten fine.

Privacy

This tool runs 100% in your browser. Your data is never uploaded, stored, or logged.