JSONPath Tester

    Query and filter JSON with JSONPath expressions, evaluated as you type.

    JSON document
    Matches
    2 matches

    How to Test a JSONPath Expression

    1. 1

      Paste your JSON

      Any object or array. The classic bookstore document is preloaded so the example expressions work immediately.

    2. 2

      Write an expression

      Start from $ for the root. Use dots to descend, .. to search at any depth, [*] for every element and [?(…)] to filter.

    3. 3

      Read the matches

      Results update as you type and the match count is shown. Switch to Paths to see where each match came from instead of its value.

    4. 4

      Reuse it in code

      The same expression works with jsonpath-plus in JavaScript, jsonpath-ng in Python, and the JSONPath support built into tools like Kubernetes kubectl.

    Frequently Asked Questions

    JSONPath is a query language for JSON, playing a similar role to XPath for XML. An expression describes a route through a document — $.store.book[0].title — and evaluating it returns every value that matches. It is used for extracting fields from API responses, filtering arrays and asserting on payloads in tests.

    $ is the root of the document. Every expression starts there. A single dot descends one level, so $.store.book selects the book array, while two dots search at any depth, so $..author finds every author anywhere in the document.

    Use a filter expression: $.store.book[?(@.price < 10)] returns every book cheaper than 10. Inside the filter, @ refers to the element being tested. You can also test for existence — $..book[?(@.isbn)] returns only the books that have an ISBN.

    By default the evaluator returns the matching values. Switching to Paths returns the location of each match instead, such as $['store']['book'][2], which is useful when you need to modify the original document rather than read from it.

    Use a slice: $.store.book[-1:] returns the last element. Slices follow the same start:end:step form as Python, so [0:2] takes the first two and [::2] takes every other one.

    It was originally an informal proposal, and implementations drifted apart on the details. RFC 9535 standardised it in 2024. This tester uses jsonpath-plus, which follows the widely adopted Goessner conventions and supports the common extensions.

    Related Tools