DuckyTools
Home Convert JSON Flattener

JSON Flattener Convert

Flatten deeply nested JSON into dot-notation keys, or expand it back.

JSON Flattener is a free online tool that flatten deeply nested JSON into dot-notation keys, or expand it back. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free — no account, no quota, no watermark
Category
Convert
Where it runs
In your browser, on your device
Files uploaded
None
Technology
plain JavaScript
Settings
2
Works offline
Yes, after the first visit

About JSON Flattener

Nested structure is collapsed into single-level keys joined by dots — `{"user":{"address":{"city":"Leeds"}}}` becomes `{"user.address.city":"Leeds"}`. This is what you need before loading JSON into a spreadsheet, a CSV, a feature-flag system or anything else that expects flat key-value pairs. Array indices become numeric path segments.

How to use it

  1. Paste the text you want to run through json flattener.
  2. Set direction and separator.

The 2 settings

SettingWhat it doesDefault
DirectionChoose from 2: Flatten, Expand back.Flatten
SeparatorFree text..

Under the hood

Runs onplain JavaScript — runs the whole thing
ControlsDirection, Separator

Questions

Can it be unflattened?

Usually, but not always — a literal dot inside an original key is indistinguishable from a path separator once flattened. Choose a separator that does not appear in your keys if you need to reverse it.

How are arrays handled?

By index: `items.0.name`, `items.1.name`. That preserves order and position, which bracket notation would too — the dot form is simply more common in config systems.