JSONPath Evaluator
Run a JSONPath expression against a document and see the matches live, with a syntax cheatsheet.
Runs entirely in your browser — nothing you paste is uploaded.
About JSONPath Evaluator
JSONPath is XPath for JSON: a compact expression language for pulling values out of a document without writing code. It shows up in Kubernetes `kubectl -o jsonpath`, in AWS CLI `--query`, in Postman assertions, in Jenkins and Ansible and half the CI tooling in existence — and it is much easier to write with live feedback than by trial and error against a real API.
Type an expression and the matches update as you go, each with the concrete path that produced it. That path output is the part that saves time: when an expression returns three things and you expected one, seeing `$.items[2].tags[0]` tells you immediately whether your filter is too loose or your document is shaped differently than you thought.
The syntax worth knowing is short. `$` is the root. `.key` and `['key']` select a property. `[0]` indexes an array and `[-1]` counts from the end. `[1:4]` slices. `*` is a wildcard at one level and `..` is a recursive descent through every level. `[?(@.price < 10)]` filters, where `@` is the current node.
An invalid expression shows a readable message rather than throwing — you'll be typing half-finished expressions constantly, and a tool that blanks out on every keystroke is worse than no tool.
Frequently asked
›What is the difference between `.` and `..`?
`.` selects a direct child: `$.store.book` finds `book` only immediately under `store`. `..` is a recursive descent that searches every level: `$..book` finds every `book` key anywhere in the document, at any depth.
›How do I filter an array?
With a filter expression: `$.items[?(@.status == 'active')]`. Inside the filter, `@` refers to the current element. Comparisons, `&&`, `||` and negation all work, and `$..items[?(@.price)]` filters on mere presence of a key.
›Is JSONPath standardised?
It is now — RFC 9535 was published in 2024. Before that it was a de-facto standard from a 2007 blog post, and implementations diverged on filters, slices and how results are ordered. Expect small differences between libraries, particularly around edge cases in filter syntax.
›How do I select the last element of an array?
`[-1]` in implementations that support negative indices, or `[(@.length-1)]` in older ones. `$..book[-1:]` — a slice from the last element — works in the widest range of implementations.
›JSONPath or jq?
JSONPath selects; jq transforms. If you need to reshape, aggregate or compute, jq is the better tool. If you need to pull specific values out of a document — which is what CI tooling and API assertions want — JSONPath is smaller and is what those tools already accept.