Dad’s Data formats tools

JSON Flattener

Flatten nested JSON to dot-notation keys, or unflatten back to nested form. 100% local.

Separator
Nested JSON Input
Flat JSON Output
Paste nested JSON to flatten it.

Flattening and the Dot-Notation Format

Flattening collapses a nested JSON object into a single-level object where each key describes the full path to its value. A nested object like {"user": {"name": "Alice"}} becomes {"user.name": "Alice"} — the dot separates each level of nesting.

Common uses include: environment variable systems (most do not support nested objects natively), CSS-in-JS design token files that expect flat key maps, diff-friendly config files where one value per line is easier to review, and APIs that only accept flat query parameters or form bodies.

Nested → Flat (dot separator)
Input
{
  "user": {
    "id": 1,
    "name": "Alice",
    "address": {
      "city": "London",
      "country": "UK"
    }
  },
  "config": {
    "theme": "dark",
    "language": "en"
  }
}
Output
{
  "user.id": 1,
  "user.name": "Alice",
  "user.address.city": "London",
  "user.address.country": "UK",
  "config.theme": "dark",
  "config.language": "en"
}

Separator Options

The separator character is inserted between path segments. Choose the one that fits your target system.

SeparatorExample keyUse when
. (dot)user.address.cityMost readable; standard for most tools and libraries
_ (underscore)user_address_cityWhen keys already contain dots; AWS Parameter Store
/ (slash)user/address/cityFile-path style; HashiCorp Vault, Consul, some CLIs
Warning: If your keys already contain the separator character — for example a key named "user.id" with the dot separator — flattening will create an ambiguous path that cannot be correctly unflattened back to the original structure. Choose a separator that does not appear in any of your existing key names.

How Arrays Are Handled

Array elements become indexed path segments using the same separator. For example, {"tags": ["a", "b"]} flattens to {"tags.0": "a", "tags.1": "b"}. Round-tripping arrays through flatten → unflatten works correctly — the numeric indices are recognized and the array is reconstructed in order.

Tip: Array indices always use the same separator as object keys. Switching separator on the unflatten step must match the separator used during flatten or the indices will be misread as string keys.

Try It

Interactive — edit the input to see the output update
Try it
Result

Frequently Asked Questions

Your files stay on your computer. Dad promised.

Data formats tools

Search the Data formats tools