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 - or simply pretty-print or minify the JSON. JSON you paste is processed entirely in your browser and never leaves this tab. To inspect a live API instead, the Execute cURL tab runs a curl command online and fetches the response for you through a proxy.

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

JSON Tools

Eight tools, one engine. Each runs entirely in your browser, and the JSON you have pasted comes with you when you switch between them.

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. To fetch a live response instead, switch to the Execute cURL tab, paste a curl command, and click Execute. That request goes through a proxy to get around browser CORS, and it is the only part of the tool that sends anything off your machine - how the cURL runner works, and its limits.
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. On the Execute cURL tab, click Extract Keys next to the response status and the JSON body is carried over and extracted for you.
3
Choose an output format - dot-notation paths, paths annotated with value types, unique key names, JSONPath expressions, an indented tree, a TypeScript interface, or the JSON itself - formatted with a 2- or 4-space indent, or minified. 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.
Formatted or minified JSONReading a one-line API response, or squeezing JSON back onto one line for a log, a queue, or a config value. Only whitespace changes: large integers, trailing zeros like 12.50, and key order come out exactly as pasted.

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. Paste the curl command from the API docs to map a live response directly.

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, not for JSON you paste. All parsing and key extraction happens in JavaScript inside your own browser tab, and pasted JSON is never transmitted, logged, or stored anywhere. You can confirm this by opening your browser's network tab while extracting keys, or by disconnecting from the internet after the page loads - key extraction keeps working. The one exception is the Execute cURL tab, which has to send your request through a proxy because browsers block cross-origin calls; see the privacy policy for what that involves.

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 pretty-print or minify JSON?

Yes. Choose Formatted JSON (2-space or 4-space indent) or Minified JSON in the format list. Unlike formatters that parse and re-serialise, it changes only whitespace, so large integers such as 1839274619283746817, decimals such as 12.50, key order, and duplicate keys come out exactly as you pasted them. The JSON formatter page shows what the usual approach does to those values.

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. A key that is present but null on some elements stays required and gains | null instead - the sample's trackingCode is generated as trackingCode: string | null. The JSON to TypeScript page explains why that distinction matters.

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.

Can I use JSON Keyper to store or host my JSON?

No. JSON Keyper does not save your JSON or give it a URL - it is parsed in your browser and discarded when you close the tab. That is a design choice rather than a missing feature: there is no copy on a server to leak, expire, or be fetched by anyone else later. The Execute cURL tab does send your request through a proxy to reach the API you named, but nothing is retained there either. If you need JSON hosted at a shareable endpoint, for a mock API or a demo, you want a JSON storage service, which is a different category of tool.

Can I fetch JSON from an API directly, instead of pasting it?

Yes. Switch to the Execute cURL tab, paste a curl command, and JSON Keyper sends it through a Cloudflare Worker proxy to bypass the browser's CORS restrictions. The proxy fetches the response and hands it back to the page, where you can extract keys from it just like pasted JSON. It only reaches public http and https URLs, times out after 5 seconds, and caps responses at 2 MB; it does not log or store requests or responses. Run a curl command covers which curl options work and exactly what the API receives.

Further Reading

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

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

Who Maintains JSON Keyper

AS

Ashish Singh

JSON Keyper is built and maintained by one person: a back-end developer with more than four years of professional experience in Java/Spring Boot, Python, and Node.js/TypeScript. It started as the throwaway script I kept rewriting to list the fields in API responses I did not design. More about me and how the guides are written.

Recent changes (full history in the changelog):

JSON Keyper has no accounts and no paywall. If it saves you time, you can support the project on GitHub Sponsors.

Found a document the tool handles wrongly? Tell me, or open an issue on GitHub.