JSON Path Finder — Get JSONPath from JSON Object

Paste JSON and click any string, number, boolean or null to see its JSONPath expression. Collapse branches to navigate nested structures, then copy the exact path to your clipboard. 100% client-side — your data stays private.

JSON Path Finder

Input (JSON)
Click a value to see its path Ready

What is a JSONPath? A JSONPath is a short expression that addresses one place inside a JSON document, in the same way an XPath addresses a node in XML. It starts at the root, written $, then names each step down: a dot before an object key and a bracketed number for an array index. $.employees[0].skills[1] means the second skill of the first employee. This tool builds that expression for you from a click.

How to Use the JSON Path Finder

  1. Paste your JSON — Drop a whole API response, a config file or a single object into the left panel. It parses as you type — Load Sample fills in a small nested document if you just want to see the output shape first.
  2. Check that it parsed — The tag above the tree turns green and reads Parsed. If the JSON is malformed it turns red and the browser's own parser message appears below, naming the character position where it gave up.
  3. Explore the tree — The right panel mirrors the document's structure. Click an opening { or [ to collapse that branch, which is the fastest way to skim a long array down to the one record you care about.
  4. Click the value you want — Click a string, number, boolean or null — the leaves of the tree. The clicked node is highlighted and its full path appears in the JSONPath bar underneath, starting from $.
  5. Copy and use the pathCopy Path puts the expression on the clipboard. Drop the leading $. and it is also a valid JavaScript accessor, so $.config.features.beta becomes config.features.beta in code.

How the Path Is Built

The document is parsed once with JSON.parse and then walked recursively. Each recursion carries the path of the node it is rendering, starting from the root token $, and appends one segment per level as it descends. Two rules cover everything: an object key is appended after a dot, and an array element is appended as its index in square brackets. Because the path is assembled during the walk rather than searched for afterwards, it is exact by construction — there is no guessing about which of three name fields you clicked.

PathWhat it addresses
$The document root, before any step
$.companyA top-level object key
$.employees[0]The first element of an array — indices are zero-based
$.employees[1].roleA key inside an array element; dots and brackets mix freely
$.config.features.betaNesting continues to any depth
$.employees[0].skills[1]An array inside an array element

Only leaves are clickable

Strings, numbers, booleans and null respond to a click; objects and arrays do not. Clicking a bracket collapses the branch instead, which is what you almost always want when a payload has fifty records and you need the third. If you need the path of a container, take the path of any value inside it and remove the last segment — $.config.features.beta minus .beta is the object you were after.

Where the notation runs out

Dot notation is readable but it cannot express every key. A key containing a dot, a space, a hyphen or a leading digit — "content-type", "user.name", "2024" — produces a path that reads correctly but is ambiguous or invalid to a strict evaluator. The portable form in JSONPath is bracket-with-quotes notation: rewrite $.user.name as $['user.name'] when the key genuinely contains that dot. Duplicate keys are a related trap: JSON.parse keeps only the last occurrence, so a repeated key simply will not appear in the tree.

How JSONPath compares with the alternatives

Several notations address the same value and they are easy to confuse when you copy one into a tool expecting another. All four below point at the same string in the sample document.

NotationExpressionWhere you use it
JSONPath$.employees[0].nameTest assertions, API gateways, log pipelines, most jsonpath libraries
JavaScript accessoremployees[0].nameApplication code — the same path without the root token
JSON Pointer (RFC 6901)/employees/0/nameJSON Patch, OpenAPI and JSON Schema error locations
jq.employees[0].nameShell pipelines — a leading dot instead of a dollar

JSONPath goes further than this tool needs to: the full syntax adds wildcards ($.employees[*].name), recursive descent ($..name), slices and filter expressions. Those select many values at once, whereas this page always gives you the single concrete path to the thing you clicked — which is exactly what you want as the starting point before you generalise it into a query.

Frequently Asked Questions

Paths start at the root token $, join object keys with a dot and write array indices in square brackets, so a typical result looks like $.employees[0].name. That is the bracket-and-dot form accepted by the common JSONPath libraries in JavaScript, Python, Java and Go. Removing the leading $. gives you a plain JavaScript property accessor for the same value.

Only leaf values — strings, numbers, booleans and null — are selectable. A click on an opening bracket collapses that branch instead, which is how you fold a long array down to the part you are reading. To get a container's path, select any value inside it and delete the final segment from the copied expression.

Yes, and they are zero-based, so the first element is [0]. Indices nest with keys in either order: $.employees[1].skills[0] is the first skill of the second employee. The index shown in the tree is the position in the parsed array, which is also the position your code will use.

Parsing and rendering both happen in JavaScript in your tab, and no request carries your document. One caveat worth knowing: the contents of the input box are also written into the page URL so a session can be bookmarked or reloaded. Nothing is transmitted by that, but do not share the link if the payload holds tokens or customer data.

The path is still built with a dot separator, so a key such as content-type or user.name produces an expression that is ambiguous to a strict JSONPath evaluator. Rewrite that segment in bracket notation with quotes — $['content-type'] — which every implementation accepts and which removes the ambiguity entirely.

Ordinary API responses and config files render instantly. The whole tree is built as HTML in one pass with no virtualisation, so a multi-megabyte document with tens of thousands of nodes will make the tab pause while it renders and will use a lot of memory. If you are working at that size, slice out the section you care about first, or use a streaming tool such as jq.

Check what the consuming system expects. JSON Pointer (RFC 6901) writes the same address as /employees/0/name and is what JSON Patch operations and JSON Schema validation errors use. JSONPath is the query language used by test frameworks, API gateways and log processors, and unlike Pointer it can also express wildcards and filters. Converting between them by hand is mechanical: swap the separators.

The parser follows the strict JSON grammar, so the usual culprits are a trailing comma after the last element, single quotes instead of double quotes, unquoted keys, a comment, or a stray NaN or undefined from a JavaScript literal. Those are all legal JSON5 or JavaScript but not JSON. The error message under the input gives the character position — run the document through the JSON Formatter if you want the problem highlighted in context.

Use Cases

Finding a Field in an Unfamiliar API Response

A vendor returns three hundred lines of nested JSON and you need the one field the docs call "status". Collapse the branches, click it, and you have the accessor to paste into your parser without counting brackets.

Writing an API Test Assertion

Postman, REST Assured and most contract-test frameworks assert against a JSONPath. Click the value in a recorded response and paste the expression straight into the assertion instead of typing it from memory.

Documenting a Payload Contract

When writing integration notes for another team, give each field its exact path rather than a prose description. "The value at $.order.shipping.postcode" leaves no room for the wrong nesting level.

Mapping Fields for a Transformation

Building an ETL step or a low-code connector means listing source paths one at a time. Click through the sample payload and collect the paths before you write the mapping, rather than debugging typos afterwards.

Configuring a Log or Metrics Extractor

Structured log pipelines pull fields out of JSON events by path. Paste one real event, click the field you want to index or alert on, and use the path in the extractor rule.

Turning a Diff Result Into Working Code

After JSON Diff tells you which path changed, load the same document here to see the value in context and confirm the path resolves to what you expected before you act on it.