Flatten nested JSON into single-level dot-notation keys and unflatten it back. Ideal for CSV export, i18n files, and key-value config. Custom separators, 100% client-side.
Deeply nested JSON is great for programs but awkward for many real-world tasks — you cannot easily put it in a spreadsheet, a translation file, or a flat key-value store. Flattening solves this by collapsing the whole structure into single-level keys that encode the path, like user.address.city. This tool flattens any JSON instantly, and just as importantly, unflattens dotted keys back into the original nested shape when you need the structured form again.
Both directions run live as you type, with clear error messages if the input is not valid JSON. Arrays are handled correctly in both directions, and you can customise the separator to match whatever convention your target system uses.
Perfect for Data Wrangling
Flattened JSON is the bridge between structured data and flat formats. Developers use it to export nested API responses to CSV, to build and manage internationalisation (i18n) files where keys like home.header.title are the norm, to serialise objects into form fields, and to feed key-value configuration systems and feature-flag stores. Unflattening does the reverse — turning a flat config or a spreadsheet column of dotted keys back into a usable nested object.
Because the whole process is instant and client-side, you can iterate quickly and keep even sensitive data private. Copy or download the result in one click, ready to drop into your pipeline.
How to use this JSON Flatten / Unflatten?
1
Choose Direction
Flatten nested JSON, or unflatten dotted keys back to nested form.
2
Paste JSON
Drop your JSON in — it is validated live.
3
Set Separator
Use the default dot, or any custom separator your system expects.
4
Copy or Download
Grab the converted output with one click.
Frequently Asked Questions
Flattening converts a deeply nested JSON object into a single-level object whose keys are dotted paths. For example, {"a":{"b":1}} becomes {"a.b":1}. This makes nested data easy to export to CSV, use in translation files, store as key-value config, or serialize into form fields.
Yes. Switch to Unflatten mode (or click swap) to rebuild the original nested structure from dotted keys. So {"a.b":1} becomes {"a":{"b":1}}. Numeric path segments are correctly rebuilt as arrays.
Array elements are flattened using their index as a path segment — for example, {"roles":["admin","editor"]} becomes {"roles.0":"admin","roles.1":"editor"}. When unflattening, numeric segments are turned back into arrays automatically.
Yes. The default separator is a dot, but you can change it to any character or string — for instance an underscore or a slash — to match the convention your target system expects.
No. Flattening and unflattening happen entirely in your browser. Your JSON never leaves your device, so it is safe for private data.