Flatten JSON to Dot Notation
Flatten nested JSON into one level of dot.path keys, or unflatten dot-notation keys back into nested objects and arrays.
Free · No sign-up · Your inputs stay in your browser
Input
Flatten nested JSON to dot paths, or back
Output
Flat object
14 keys
Dot paths are what Laravel's Arr::dot() and data_get() use, and what most translation files and config stores expect. Empty objects and arrays are kept as values so a round trip loses nothing.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
Where dot paths are used
Laravel's Arr::dot(), data_get() and validation rules address nested data with dot paths, and so do translation files, feature-flag services, spreadsheet exports and most key-value config stores. Flattening is also the quickest way to diff two large JSON documents line by line, because every value ends up on its own line with its full path.
Brackets or dots for arrays
Some tools write array indexes as items[0].id (lodash's _.get, JavaScript itself) and others as items.0.id (Laravel, MongoDB). Both forms are read back when unflattening. Keys that already contain the separator are ambiguous, so pick a separator that does not appear in your keys.