Run a JSONPath expression and inspect the matches

Query JSON with a tiny JSONPath selector.

Paste JSON, write a JSONPath expression like $.store.book[*].title, and see the matches. Supports dot notation and bracket indexes. Pure browser.

JSON

Matches

[
  "Dune",
  "Foundation",
  "Neuromancer"
]

Querying JSON with JSONPath

JSONPath is a small query language for picking values out of a JSON document, the way XPath does for XML. Stefan Gössner proposed it in 2007, and in 2024 it became an official IETF standard, RFC 9535. Tools such as Postman, Kubernetes' kubectl, AWS Step Functions and many testing frameworks use it to point at a value inside an API response.

Paste a JSON document, type a path and see every match instantly. It is a quick way to test a path before you put it in a test assertion, a monitoring rule or a data pipeline.

How to use it

  1. Paste your JSON into the JSON box.
  2. Type a selector starting with $, the root of the document.
  3. Read the matches, shown as a JSON array.
  4. Adjust the path until the matches are exactly the values you need.

Example: all book titles in a store

Input
$.store.book[*].title
{"store":{"book":[{"title":"Dune","price":9.99},{"title":"Emma","price":4.5}]}}
Output
[
  "Dune",
  "Emma"
]

The [*] wildcard visits every book in the array, and .title takes the title of each one.

The supported syntax

$ is the root. A dot followed by a name moves into that property: $.store.bicycle. Square brackets with a number pick an array element, counting from zero: $.store.book[0] is the first book. [*] selects every element of an array or every value of an object, and you can continue after it, as in the example.

That covers most paths used in tests and configuration. The full RFC 9535 language also has recursive descent ($..title, every title at any depth), slices such as [0:2], negative indexes, quoted names like ['first name'] and filter expressions such as [?@.price < 5]. Those are not supported here; a path that uses them is reported as invalid instead of returning wrong matches.

JSONPath, jq and JMESPath

jq is a command-line tool with its own, more powerful language that can also transform data. JMESPath is used by the AWS CLI's --query option. The three look similar but are not compatible, so check which one a tool expects. Kubernetes' -o jsonpath uses JSONPath with braces around expressions, as in {.items[*].metadata.name}.

Questions

Why is the result always an array?

A path can match zero, one or many values, so matches are always returned as a list. Take the first element when you expect exactly one.

What happens if a property does not exist?

The path simply has no match there and the result is an empty array; it is not an error.

Is my JSON uploaded?

No. Parsing and querying happen in your browser.