Skip to the tool
GigaJSON JSON Path Finder
All tools
Format and check
View and query
Convert
JSON to code
Encode and decode
Sample files
Guides Open GigaJSON

JSON Path Finder

Click any value to get its path in JSONPath, jq, Python, JavaScript and 6 more formats. Runs in your browser.

Paste JSON and click a line of the text or a node of the tree to get its path, written ten ways: JSONPath ($.items[0].sku), jq (.items[0].sku), JMESPath (items[0].sku), JavaScript (data.items[0].sku), Python (data["items"][0]["sku"]), JSON Pointer (/items/0/sku, the form JSON Patch and OpenAPI $ref use), an n8n expression ({{ $json.items[0].sku }}), Postman (pm.response.json().items[0].sku), PowerShell ($data.items[0].sku) and PHP ($data['items'][0]['sku']). The format you pick stays on top with a Copy button, and the page remembers it. On a path through a list, All items writes one path for every item, such as $.items[*].sku or data.items.map(x => x.sku), and lists the values it matches. Keys with spaces, dots or quotes are quoted the way each language expects. To find a value, type part of a key or value in the search box. To see where a path you already have points, paste it there. To run a path against the whole document, use the JSONPath Tester or the jq Playground.

How to use it

  1. Pick an example, paste JSON or open a file.
  2. Click a line of the text or a node of the tree, or search for a key or value. You can also paste a path to see where it points.
  3. Choose your format and copy the path. On a path through a list, choose All items to get one path for every item.

Read more: JSONPath examples in JavaScript, Python, PostgreSQL and kubectl · n8n $json expressions explained: paths, items and $jmespath

Private, and made for big files

This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. JSON and XML input can be up to 1 GB, depending on available memory. Processing runs in a background worker; large analyses can take a minute or more. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.

One value, six path formats

Paste this document and select Ada:

{"orders":[{"customer.name":"Ada","items":[{"sku":"KB-01"}]}]}

The dot is part of the key. The six paths to that value are:

LanguagePath
JSONPath$.orders[0]['customer.name']
jq.orders[0]["customer.name"]
JavaScriptdata.orders[0]["customer.name"]
Pythondata["orders"][0]["customer.name"]
JSON Pointer/orders/0/customer.name
n8n{{ $json.orders[0]["customer.name"] }}

For the SKU, use $.orders[0].items[0].sku in JSONPath. Indexes start at zero. Keys containing spaces, quotes or backslashes also need escaping; copy the generated path rather than editing it by eye.

A path identifies a value. A filter selects matching records. Run the path in the JSONPath tester, or compare query forms in the query-language guide.

GigaJSON path finder showing a customer.name key as JSONPath, jq and JavaScriptGigaJSON path finder showing a customer.name key as JSONPath, jq and JavaScript (dark theme)
A dot inside a key needs brackets and quotes. It is not another level of nesting. Screenshots follow the page theme. Click to view full size.

Questions

What is a JSON path?

The keys and list positions that lead from the top of a document to one value. In {"items": [{"sku": "A1"}]}, the path to "A1" is items, then 0 (the first item), then sku. Each language writes it its own way: $.items[0].sku in JSONPath, .items[0].sku in jq, /items/0/sku in JSON Pointer.

What is the difference between JSONPath and JSON Pointer?

A JSON Pointer (RFC 6901) points at exactly one value, with keys between slashes: /items/0/sku. JSON Patch, JSON Schema and OpenAPI $ref use it. JSONPath (RFC 9535) is a query language that can also match many values, like $.items[*].sku. In a pointer, ~ is written ~0 and / is written ~1.

How do I use the path in Python?

Copy the Python form, such as data["items"][0]["sku"], where data is what json.load() returned. Every key is in brackets and quotes, so keys with spaces, dots or dashes work as they are. A missing key raises KeyError.

How do I get an n8n expression for a field?

Copy a node's output from n8n's JSON view, paste it here and click the field. The n8n form gives the expression for the current item, such as {{ $json.body.city }}: the first list index is left out, because $json is already one item. Paste it into a field in expression mode.

How are keys with spaces or dots written?

In brackets with quotes: $['first name'] in JSONPath, .["first name"] in jq and data["first name"] in JavaScript. Quotes and backslashes inside a key are escaped, so the path reads back the same value.

Can I use the path in a query?

Yes. The JSONPath form works in the JSONPath tester and the jq form in the jq playground. Both start from the root of the document.

How do I get a path for every item in a list?

Select a value inside a list and choose All items. The index becomes a wildcard: $.items[*].sku in JSONPath, .items[].sku in jq, data.items.map(x => x.sku) in JavaScript and [x["sku"] for x in data["items"]] in Python. The values it matches are listed under the path. JSON Pointer has no wildcard, so it points at one item only.

How do I use the path in PowerShell or PHP?

The PowerShell form expects $data = Get-Content data.json -Raw | ConvertFrom-Json, and the PHP form expects $data = json_decode($json, true). PowerShell reads a property from every item of a list by itself, so $data.items.sku returns every SKU.

Does it work with large files?

Yes. A large document opens one level deep in the tree, and you open the branches you need. The text pane shows files up to 2 MB. Search lists the first 8 matches and counts the rest.

Is my data uploaded?

No. The tool runs in your browser, in a background worker. Nothing you paste or open goes to a server, and nothing is kept after you leave the page.

All tools