Skip to content
toolbelt

JSONPath Query

Query JSON with JSONPath expressions, including wildcards, recursive descent and simple filters. See exactly which nodes matched before you write the code.

read guide
path
examples
json0 ln / 0 ch
result
ready
local / nothing uploaded

About this tool

JSONPath is to JSON what XPath is to XML: a small query language for reaching into a document. Instead of writing nested loops to find a value, you write an expression and see every node that matches.

How to use it

  1. Paste the JSON document.
  2. Type a JSONPath expression such as $.users[*].name.
  3. See every matched node in the result pane.
  4. Try an example if the syntax is unfamiliar.

Examples

Names of all users

$.users[*].name
["Ada","Grace"]

Filter by role

$.users[?(@.role == admin)]
[{"name":"Ada","role":"admin"}]

Limits and notes

  • JSONPath has no single formal standard, so syntax varies between implementations.
  • This implementation supports child, index, wildcard, recursive descent and simple comparisons; functions such as length() are not included.

Frequently asked questions

What does the dollar sign mean?
It is the root of the document. Every expression starts there, for example $.items[0] for the first element.
What does double dot do?
Recursive descent. It searches the current node and every descendant, so $..id finds every id key at any depth.
Why does my filter return nothing?
Filters run against arrays. Check that the path before the filter selects an array and that the compared value is quoted correctly for strings.

Want the details? Read the full guide: Finding One Field in a Huge Response.