Flatten JSON
Convert nested JSON to flat dot-notation key-value pairs. Fast, free, and fully client-side.
How the Flatten JSON Works
Converts a nested JSON object into a single-level object whose keys are dot-joined paths, such as "user.address.city". Array elements use numeric segments like "tags.0". Empty objects and empty arrays are kept as their literal values. The conversion runs in your browser and the input is never uploaded.
Usage Example
Turning a nested service configuration into key-value pairs for a flat environment file or spreadsheet import.
Frequently Asked Questions
What happens to arrays when flattening?
Each element becomes its own key with its index as the final segment, so a tags array holding two strings yields tags.0 and tags.1. Arrays of objects continue the same pattern with more dot-separated segments.
Are empty objects and arrays preserved?
Yes. An empty object or empty array is kept as its own value instead of being dropped, so the flattened output still shows that the key existed. The result is printed with two-space indentation.
Can the flattening be reversed?
Yes, pass the output to the Unflatten JSON tool. It splits keys on dots and rebuilds nested objects, creating an array wherever the next segment is numeric. Keys that themselves contain dots will not round-trip cleanly.
Browse more
See all JSON tools.
