Turn a deeply nested JSON document into a flat list of key paths. Every field gets one line, written in dot notation with bracket notation for array positions. Useful when you need an inventory of what a payload actually contains - before writing parsing code, building a field mapping, or documenting a schema.

Flatten your JSON

Opens the tool with dot-notation key paths already selected.

Open the flattener

A worked example

Given this order payload:

{
  "user": {
    "name": "Ada Lovelace",
    "address": { "city": "London", "country": { "code": "GB" } },
    "roles": ["admin", "engineer"]
  },
  "orders": [
    { "orderId": "ord_1001", "total": 249.99 },
    { "orderId": "ord_1002", "total": 15.50, "giftMessage": "Happy birthday" }
  ]
}

Flattened, with every array element at its literal index:

user
user.name
user.address
user.address.city
user.address.country
user.address.country.code
user.roles
orders
orders[0].orderId
orders[0].total
orders[1].orderId
orders[1].total
orders[1].giftMessage

And with Collapse array indices enabled, repeated positions merge into [] and duplicates drop out:

user
user.name
user.address
user.address.city
user.address.country
user.address.country.code
user.roles
orders
orders[].orderId
orders[].total
orders[].giftMessage

The collapsed view is the one you want when documenting a schema - it answers "what fields exist" rather than "what does this particular record contain". Notice that giftMessage still appears even though only the second order has it, so the collapsed list is the union of all fields seen.

Why intermediate keys are included

Container keys appear as their own lines alongside their children - user.address is listed as well as user.address.city. This is deliberate. Knowing that address is an object rather than a flat string is part of understanding the shape, and it makes the output usable as a structural inventory rather than only a list of leaves.

If you want the type at each position too, the typed paths format annotates every line with object, array, string, number, boolean, or null.

Common uses

  • Field mapping for ETL - get the complete source field list before writing a transformation
  • Loading into a spreadsheet or relational table - flat paths become column names
  • Comparing two API responses - diff the two flattened lists to see exactly which fields were added or removed between versions
  • Documenting a payload - paste the collapsed output straight into a design doc or ticket
  • Debugging a missing field - confirm whether a field is genuinely absent or just at a different path than you assumed

Keys containing dots

If a key name contains a literal dot, dot-notation paths become ambiguous - user.name could mean a nested name under user, or a single key literally called "user.name". When that distinction matters, use the JSONPath format instead, which disambiguates by quoting such keys in brackets.

How to use it

  1. Copy a JSON response from your API client, DevTools, or a .json file
  2. Open the flattener - dot-notation paths are preselected
  3. Paste into the left box, or drag a file onto it
  4. Toggle Collapse array indices depending on whether you want a schema view or a record view
  5. Click Extract Keys, then copy or download the result

Other output formats

Further reading