JSON Flattener
Flatten nested JSON into single-level dot-notation keys online. Choose the separator, bracket or dotted array indexes, and copy or download the result.
What is the JSON Flattener?
The ByteTools JSON Flattener turns a deeply nested JSON document into a single-level object whose keys are full paths, such as user.
- Recursive flattening of nested objects and arrays
- Dot, underscore, slash or hyphen separators
- Bracket items[0] or dotted items.0 array indexes
- Optionally keep empty objects and arrays as values
- Flat JSON or plain key = value output
- 100% private — JSON never leaves your browser
How to use the JSON Flattener
- 1
Paste your nested JSON into the input box, or drop a .json file to load it.
- 2
Choose the key separator and whether array indexes use brackets or the separator.
- 3
Pick flat JSON or a key = value list as the output format.
- 4
Click Flatten JSON, then copy the result or download it.
About the JSON Flattener
The ByteTools JSON Flattener turns a deeply nested JSON document into a single-level object whose keys are full paths, such as user.address.city or items[0].price. Nested objects and arrays are walked recursively so every leaf value ends up with one unambiguous key you can read, grep or feed into another system.
It is useful when you need JSON in a tabular shape: loading records into a spreadsheet, building translation or config files, mapping API fields for an ETL job, or diffing two payloads line by line. You can pick the key separator, switch array indexes between items[0] and items.0, and output either flat JSON or a plain key = value list.
Flattening runs 100% locally in your browser with JavaScript. Your JSON is never uploaded, logged or stored, so it is safe to use on production API responses, private configuration and customer data.
Frequently asked questions
What does it mean to flatten JSON?
Flattening replaces nesting with path-style keys. Instead of an object inside an object, you get one level where the key spells out the whole route to the value, like user.address.city. That makes JSON far easier to put in a spreadsheet, compare or search.
How are arrays handled when flattening JSON?
Each element gets its index in the key. With bracket notation you see items[0].name and items[1].name; switch to separator notation and the same paths become items.0.name and items.1.name. Pick whichever your target system expects.
Can I flatten JSON back into nested form again?
Yes. Use the JSON Unflattener with the same separator and your dot-notation keys expand back into the original nested structure, including arrays where the path segments are numeric.
What happens if a key already contains a dot?
The dot inside the original key becomes indistinguishable from a path separator, so round-tripping that key is ambiguous. If your data has dots in key names, choose a different separator such as a slash before flattening.
Is my JSON uploaded anywhere?
No. The whole conversion happens in your browser with JavaScript. Nothing is sent to a server, logged or stored, so confidential payloads stay on your machine.
Related tools
JSON Unflattener
Expand flat dot-notation keys back into nested JSON online. Rebuilds objects and arrays from paths like user.address.city or items[0].price, in your browser.
JSON to CSV Converter
Convert a JSON array of objects to CSV online. Automatic column headers from the union of all keys, delimiter choice and proper quoting — all in-browser.
JSON Path Finder
Evaluate a dot/bracket path against your JSON and list every leaf path for discovery. Free online JSON path finder that runs 100% in your browser.
JSON Formatter
Format, beautify and minify JSON online with 2-space, 4-space or tab indentation. Sort keys alphabetically and catch syntax errors instantly — free and private.
JSON Diff
Compare two JSON documents structurally and see added, removed and changed values by path, ignoring key order. Free online JSON diff, 100% in your browser.