Flatten nested JSON into a single-level object with dot-notation keys, or unflatten dot-notation keys back into nested JSON. Useful for key-value stores, spreadsheets, environment variables and diffing. It runs in your browser.
Nested JSON
{
"user": {
"id": 1,
"name": "Alice",
"tags": ["a", "b"],
"address": { "city": "NYC" }
},
"active": true
}Flattened
{
"user.id": 1,
"user.name": "Alice",
"user.tags": [
"a",
"b"
],
"user.address.city": "NYC",
"active": true
}Nested objects are joined with a dot, so user.address.city points at the city. Arrays are kept as values rather than being split into indexed keys.
Flat JSON
{
"a.b": 1,
"a.c": 2,
"d": 3
}Unflattened
{
"a": {
"b": 1,
"c": 2
},
"d": 3
}Each key is split on the dot and the nested objects are rebuilt for you.
One caveat: keys that already contain a dot are ambiguous when you unflatten, because the dot is treated as a separator.
Flattening converts a nested JSON structure into a single-level object using dot notation for keys. For example, {"user": {"name": "Alice"}} becomes {"user.name": "Alice"}. This simplifies complex data for storage or processing.
Flatten JSON when working with flat key-value stores (Redis, environment variables), creating search indexes, building flat database schemas, or simplifying deeply nested API responses for easier data access.
Yes — switch to Unflatten mode and paste your dot-notation JSON. The tool reconstructs the original nested structure from flat keys, correctly handling arrays and deeply nested objects.