JSON key extractor — list every path, type and value in a document

Paste a JSON document to list every path in it, such as user.roles[0], with the type and a preview of the value, or switch to a count of each unique key name.

Live demo · real result from this tool

11 paths

PathTypeValue
idnumber1024
namestring"Asha Rao"
emailstring"asha@example.com"
activebooleantrue
rolesarray2 items
roles[0]string"admin"
roles[1]string"editor"
addressobject2 keys
address.citystring"Pune"
address.postcodestring"411001"
lastLoginnullnull

Paths

idnameemailactiverolesroles[0]roles[1]addressaddress.cityaddress.postcodelastLogin

Processed on your device — nothing is uploaded.

How to use the JSON key extractor

  1. Paste your JSON into JSON.
  2. Pick what to Show: Every path, Leaf values only or Unique key names.
  3. Read the table: Path, Type and Value, or Key and Occurrences for unique names.
  4. Press CSV to download the table, or copy the plain list of paths or names under it.

What it does and when to use it

When you meet a large, unfamiliar JSON document, such as a webhook payload, a third-party API response or a settings export, the first question is what is in it and where. Scrolling through braces does not answer that well. This tool gives you a list you can search, sort in a spreadsheet, or paste into a mapping document.

Typical jobs: writing a field mapping between two systems, finding the path to a value you need in a test, checking which records miss a field, or spotting a key that is spelled two ways (userId and user_id) in the unique-names view.

Once you know the path, extract matching values with the JSONPath tester. If you prefer dot-notation keys in a new object, use the JSON flattener. To put the keys in a fixed order before comparing files, use the JSON key sorter.

How it works

The document is parsed in your browser and walked depth-first in document order. Each step adds .name for a key that is a valid JavaScript identifier, ["name"] for any other key, and [n] for an array position. The type is one of object, array, string, number, boolean or null. For objects the value column shows the number of keys, for arrays the number of items, and for everything else a JSON preview.

In Unique key names mode, the tool counts every object key wherever it appears, including inside arrays, and lists the names in first-seen order. Array positions are not counted as keys.

Worked examples

{"id":7,"user":{"first-name":"Asha","roles":["admin"]},"tags":[]}

Every path:

id                 | number | 7
user               | object | 2 keys
user["first-name"] | string | "Asha"
user.roles         | array  | 1 item
user.roles[0]      | string | "admin"
tags               | array  | 0 items

Leaf values only keeps three rows: id, user["first-name"] and user.roles[0]. The empty tags array is dropped.

Unique key names for [{"id":1,"name":"a"},{"id":2,"name":"b","email":"x@y.z"},{"id":3}]:

id    | 3
name  | 2
email | 1

Limits and tips

  • Every array item gets its own rows, so a list of 5,000 records gives tens of thousands of paths. Use Unique key names first on big arrays.
  • Paths are shown without a leading $ or variable name; add your own.

Frequently asked questions

Can I paste a path straight into my code?
Yes, in JavaScript or TypeScript. Paths are written as property accessors, with dots for normal names and ["…"] for names with dashes or spaces, so data.user["first-name"] works as is. Add $. in front to use one as a JSONPath expression.
What is the difference between Every path and Leaf values only?
Every path also lists the objects and arrays on the way down, with a size such as "2 keys" or "1 item". Leaf values only lists strings, numbers, booleans and nulls, which is what you want when mapping fields. Note that empty objects and arrays are left out of the leaf list, since they hold no value.
How do I find fields that only some records have?
Use Unique key names on an array of records. Each name is listed with how often it occurs. If you have 3 records and email shows 1, two records lack it. The JSON to TypeScript tool turns such fields into optional properties for you.
Why are some values cut short?
The Value column is a one-line preview of up to 80 characters, ending in … when longer. Use the JSONPath tester to see a full value.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close