JSONPath Evaluator

Paste JSON and a JSONPath expression — see matched values instantly

JSON Input

Try a sample:

Result

Matches appear here

Enter JSON + a path, then click Evaluate

Details

JSONPath is a query language for JSON, similar to XPath for XML. This evaluator runs entirely in your browser using the jsonpath-plus library. Paste any valid JSON document, enter a JSONPath expression, and see the matching values instantly as formatted JSON. Supports the full JSONPath syntax: dot and bracket notation, wildcards, recursive descent, array slices, union operators, and filter expressions.

Examples

Extract all book authors with a wildcard

Path: $.store.book[*].author
Result: ["Nigel Rees", "Evelyn Waugh", "Herman Melville", "J. R. R. Tolkien"]

The [*] wildcard selects every element in the book array, and .author drills into each object to return all author strings.

Filter books priced under 10 with a filter expression

Path: $.store.book[?(@.price < 10)]
Result: [{"title": "Sayings of the Century", "price": 8.95}, ...]

The filter expression ?(@.price < 10) keeps only array elements whose price property is less than 10, returning matching book objects.

    Examples

    Extract every price with recursive descent

    Input
    JSON: {"store":{"book":[{"price":10},{"price":20}],"tax":1.5}}
    JSONPath: $..price
    Output
    [10, 20]

    $..price descends through every object level and collects each price value into a flat result array.

    Reach into a specific array element

    Input
    JSONPath: $.store.book[0].price
    Output
    [10]

    Zero-based indexing selects the first book; bracketed keys walk a known path without scanning the whole document.

    Filter objects by a field value

    Input
    JSONPath: $.store.book[?(@.price < 15)].price
    Output
    [10]

    A filter expression [?(...)] keeps only the books whose price is under 15, then projects their price.

    About this tool

    JSONPath is a declarative query language for JSON, originally proposed by Stefan Goessner in 2007 as a counterpart to XPath for XML. It lets you pinpoint and extract one or many nodes from a deeply nested JSON structure using a compact expression syntax — you describe the shape of the data you want and the engine does the traversal.

    This evaluator is powered by the jsonpath-plus library, which implements the original spec and extends it with parent references, script expressions, and type filters. All processing happens entirely in your browser — your JSON never leaves your machine. Paste any valid JSON, enter an expression, and matched values are returned as a pretty-printed array you can copy with one click.

    JSONPath is widely used in test frameworks (Postman, Jest), infrastructure tooling (Kubernetes patches, AWS EventBridge rules), and API gateways. Learning the core operators — dot access, wildcards, recursive descent, slicing, and filter predicates — covers the vast majority of real-world query needs.

    How to use

    1. Query nested objects with dot notation

      Paste your JSON, enter a dot-notation path such as $.user.address.city, and click Evaluate. The tool returns an array of every matched value at that nesting level.

    2. Select array items with a wildcard

      Use [*] to target every element of an array — $.orders[*].id returns the id from every order. Combine with recursive descent (..) to match at any depth.

    3. Filter array elements with a predicate

      Wrap a condition in ?() to keep only matching elements. $.store.book[?(@.price < 10)] returns books priced below 10; @ refers to the current item.

    Use cases

    Pulling nested fields out of API responses

    Reach deep into a large JSON payload for the few values you need instead of walking the structure by hand in code.

    Building configuration extractors

    Prototype the exact path an integration needs, then copy the working expression into your client or pipeline.

    Debugging unexpected shapes

    Run recursive descent ($) to see everywhere a key appears when an API changed where it nests a field.

    JSONPath operator reference

    Operator / syntaxDescription
    $Root of the document — every path starts here
    .key or ['key']Child access — a named property of an object
    ..Recursive descent — searches the entire subtree
    [*] or .*Wildcard — every child element or property
    [0], [-1]Array index — by position; negative counts from the end
    [1:3]Array slice — index 1 up to (not including) 3
    ?(@.price < 10)Filter — keeps elements where the predicate is true

    Common mistakes

    Mistake:Assuming every implementation returns a single value.

    Fix:JSONPath returns an array of matches (possibly empty or with one element). Index into the result rather than treating it as a scalar.

    Mistake:Confusing dot and bracket notation.

    Fix:Use $.store.book for simple identifiers and $['store']['book'] (quotes required) when a key contains spaces, hyphens, or reserved characters.

    Mistake:Expecting filter syntax to be identical across libraries.

    Fix:Filter expressions ([?(@.price < 15)]) vary slightly between engines; confirm the evaluator's flavor before copying an expression into production code.

    Frequently asked questions

    References & standards