Paste a nested JSON object and click Flatten. Each nested key path is collapsed into a single dot-separated key — for example, {"address": {"city": "London"}} becomes {"address.city": "London"}. Useful for converting nested configs to flat key-value stores, preparing data for CSV export, or querying deeply nested paths.
Free, fast, runs in your browser. No login needed.
.).The flattener walks your JSON object recursively. When it encounters a nested object, it joins the parent key and child key with the separator character to form a compound key. It continues until it reaches a leaf value — a primitive (string, number, boolean, null) or an array.
Arrays are preserved as-is. An array-valued field is treated as a leaf — it is not expanded into indexed keys like items.0, items.1, etc. The full array value remains assigned to the compound key. If you need indexed flattening of arrays, flatten the array elements individually before passing to this tool.
Custom separator. The default separator is a dot (.), producing keys like user.address.city. You can change it to any character — for example, __ or / — using the input field next to the Flatten button. This is useful when your key names already contain dots.
Reversing the operation. Use the Unflatten JSON tool to reconstruct the nested structure from a flattened object. Set the same separator in both directions.
Common use cases: preparing nested JSON for CSV export (the CSV converter also does this automatically); storing config values in a flat key-value store like Redis or environment variables; comparing deeply nested paths after a data migration.
Arrays are preserved as leaf values and not expanded. For example, {"tags": ["a", "b"]} becomes {"tags": ["a", "b"]} — unchanged. The flattener only descends into objects, not arrays.
Yes. Enter any character or string in the separator field before clicking Flatten. Use a separator that does not appear in your key names to avoid ambiguity when unflattening.
Use the Unflatten JSON tool. Paste the flattened output, set the same separator, and click Unflatten to restore the nested structure.
Flattening with the default dot separator will produce ambiguous output if any original keys contain dots. Switch to a separator that does not appear in your key names.
No depth limit is enforced. Arbitrarily deep nesting is supported up to the browser's JavaScript call stack limit.
No. Flattening runs entirely in your browser.