JSON Key Extractor and Path Mapper

Paste a JSON object below to get every key path it contains, including keys buried inside nested objects and arrays. Switch the output between dot notation, value-annotated paths, JSONPath expressions, a nested tree, or a generated TypeScript interface. Everything runs in your browser - your data never leaves this tab.

Input JSON Paste, or drop a .json file here
Tip: Ctrl + Enter extracts
Output 0 lines

A Worked Example

The quickest way to understand what the tool returns is to see one input mapped to each output format. Take this trimmed-down order response, the kind of payload you get back from a typical e-commerce API:

{
  "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" }
  ]
}

Key paths (dot notation)

Every key, at its literal position. Note that orders appears twice below it because there are two elements in the array.

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

The same, with array indices collapsed

Repeated indices merge into [] and duplicates are removed. This is the view you want when documenting a schema rather than inspecting one record.

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

Key paths with value types

Useful when you need to know whether a field is a string, a number, or a container before you write the parsing code.

user                        object
user.name                   string
user.address                object
user.address.city           string
user.address.country        object
user.address.country.code   string
user.roles                  array
orders                      array
orders[].orderId            string
orders[].total              number
orders[].giftMessage        string

TypeScript interface

Objects inside an array are merged, and any key missing from some elements is marked optional - here giftMessage exists on only one of the two orders.

interface Root {
  user: {
    name: string;
    address: {
      city: string;
      country: {
        code: string;
      };
    };
    roles: string[];
  };
  orders: {
    orderId: string;
    total: number;
    giftMessage?: string;
  }[];
}

Path Notation Reference

Different tools address the same nested value in different ways. This table maps a single field - the city inside the first order's shipping address - across the notations you are most likely to meet.

NotationHow the path looksWhere you use it
Dot notation orders[0].shipping.city JavaScript and Python source code, and most ORM or config field mappings.
Collapsed dot notation orders[].shipping.city Schema documentation and field-mapping spreadsheets, where the index is noise.
JSONPath $.orders[0].shipping.city jq, Postman assertions, API gateway transforms, and many low-code integration tools.
JSONPath with wildcard $.orders[*].shipping.city Selecting the same field across every element of an array in one query.
Bracket notation orders[0]["shipping"]["city"] Required when a key contains a dot, a space, or a hyphen that would break dot notation.
JSON Pointer (RFC 6901) /orders/0/shipping/city JSON Patch documents, JSON Schema $ref targets, and OpenAPI references.

The one case that trips people up is a key that literally contains a dot. If your JSON has {"user.name": "Ada"}, then the dot-notation path user.name is ambiguous - it could equally describe a nested name inside a user object. Switch to the JSONPath output in that situation, which quotes the key as $['user.name'] and removes the ambiguity.

How to Use JSON Keyper

1
Add your JSON - paste an object or API response into the left box, drag a .json file onto it, or click Load sample JSON to try the tool with a realistic order payload.
2
Click "Extract Keys" - or press Ctrl + Enter. The whole structure is walked recursively, however deeply it nests. If the JSON is malformed you get the line and column of the problem rather than a generic failure.
3
Choose an output format - dot-notation paths, paths annotated with value types, unique key names, JSONPath expressions, an indented tree, or a TypeScript interface. Switching format re-renders instantly without re-parsing.
4
Collapse array indices if you want a schema view - tick the checkbox to turn items[0].sku and items[1].sku into a single items[].sku.
5
Copy or download - send the result to your clipboard, or download it as a .txt file (or .ts when you have the TypeScript format selected).

Which Output Format Should You Use?

FormatBest for
Key pathsGrabbing an exact accessor to paste straight into code, or checking whether a specific field really exists in a response.
Key paths with value typesDeciding how to parse a payload - spotting that an id arrives as a string rather than a number before it causes a bug.
Unique key namesBuilding a field glossary, or diffing the vocabulary of two API versions to see which names were added or dropped.
JSONPathWriting jq filters, Postman test assertions, or extraction rules in an integration platform.
Indented treeGetting a visual sense of shape and nesting depth, especially for an unfamiliar payload. This view always collapses array indices, since drawing one branch per element would bury the shape.
TypeScript interfaceBootstrapping typed API clients. Treat the result as a first draft to review, not a finished contract - see the limitations below.

Use Cases

API Exploration

Understand the structure of an unfamiliar API response at a glance instead of scrolling through hundreds of lines looking for the field you need.

Data Transformation

Map source fields to destination fields in ETL pipelines and migrations. The collapsed-index view pastes cleanly into a mapping spreadsheet.

Schema Documentation

Produce a complete flat list of every field, with types, to paste into API docs or share with the team implementing against it.

Debugging

When a parser cannot find a field, extract the keys to settle whether the field is genuinely absent or simply nested where you did not expect.

Limitations Worth Knowing

No tool fits every job. These are the cases where JSON Keyper will not serve you well, and what to reach for instead:

Frequently Asked Questions

Is my JSON data uploaded to a server?

No. All parsing and key extraction happens in JavaScript inside your own browser tab. Your JSON is never transmitted, logged, or stored anywhere. You can confirm this by opening your browser's network tab while using the tool, or by disconnecting from the internet after the page loads - the tool keeps working.

Why do array indices appear in the output as items[0].name?

By default JSON Keyper reports the literal path to every key it finds, so an array of three objects produces three separate paths. Tick Collapse array indices to merge them into a single items[].name entry, which is usually what you want when you are documenting a schema rather than inspecting one specific record.

What is the difference between dot notation and JSONPath?

Dot notation such as user.address.city is how you access a value in JavaScript or Python code. JSONPath such as $.user.address.city is a query language understood by tools like jq, Postman, and many API gateways, and it supports wildcards like $.orders[*].total. JSON Keyper can output either.

Can JSON Keyper handle large JSON files?

Files up to a few megabytes are handled comfortably. Because the tool builds the full path list in memory, very large documents (tens of megabytes) may be slow or may exhaust the browser tab's memory. For files that size, a streaming command line tool such as jq is a better fit.

Does the TypeScript interface generator handle optional fields?

Yes. When an array contains several objects, JSON Keyper merges their shapes and marks any key that is absent from some elements with a question mark. In the built-in sample, giftMessage appears on only one of the two orders, so it is generated as giftMessage?: string.

What happens to keys that contain dots or special characters?

Dot notation becomes ambiguous when a key name itself contains a dot, because user.name could mean a nested field or a single literal key. The JSONPath output avoids this by quoting such keys in brackets, and the TypeScript output quotes them as string literal keys.

Further Reading

Focused guides for a single output format, each with a worked example:

Longer guides on working with JSON, written alongside this tool: