JSON Flatten & Unflatten
Turn nested JSON into a flat object with keys like address.city or items[0].name, or rebuild the original structure from flat keys. Handy for translation files, configs and spreadsheets.
Free, no sign-up
Your data stays on your device
Works offline after first open
The tool
Loading the tool…
How to use
- Paste JSON or drop the file.
- Choose Flatten or Unflatten.
- Pick the separator (usually a dot) and the array index style.
- Copy or download the result (flat output can also be a key/value table).
Privacy & how it works
Processes your data in the browser and stores nothing.
- Engine: lightweight in-page code, no external libraries.
- Works offline after you open it once.
Frequently asked questions
What is the difference between a.0 and a[0]?
Both mean the first item of array a. The [0] style is clearer and never clashes with a key named "0", so use it if your keys are numbers (like years).
Why did unflatten give an array instead of an object?
With dot style, a numeric part (like items.0) becomes an array index. If you want it as an object key, use bracket style or another separator.
What happens to an empty {}?
It stays as the value {} or [] at its key so it comes back unchanged after unflattening.
Related tools
JSON Formatter & ValidatorPretty-print JSON or minify it to one line, sort keys alphabetically, validate it with the exact line, column and cause of any error, or escape and unescape JSON strings.JSON to CSVTurn JSON or JSON Lines into a CSV table: we pick the array for you, flatten nested objects into columns like address.city, and download a file that opens in Excel with correct Arabic.JSON Viewer & JSONPath QueryBrowse JSON as a collapsible tree, search keys and values, and pull out what you need with a JSONPath query like $.items[?(@.price > 10)].name, copying any path or value.YAML ↔ JSON ConverterConvert YAML to JSON or JSON to YAML, validate a YAML file with the line number of any error, or reformat it with clean indentation. Multiple documents (---) are supported.