JSONPath Tester
Paste a JSON document, type a JSONPath expression, and this tester shows the mat
Paste a JSON document, type a JSONPath expression, and this tester shows the mat
How to use JSONPath Tester
- Paste or type your JSON into the JSON box (an example is loaded so you can start immediately).
- Enter a JSONPath expression, such as $..book[?(@.price < 10)].title, or click an example query.
- Read the matched values and their exact paths in the result panel, and copy the values with one click.
About JSONPath Tester
Paste a JSON document, type a JSONPath expression, and this tester shows the matching values and their exact paths as you type. It is built for the common Goessner-style syntax: the `$` root, `.key` and `['key']` child access, `..` recursive descent, `*` and `[*]` wildcards, numeric indexes including negatives, unions like `[0,2]`, array slices like `[1:3]`, and filter expressions such as `[?(@.price < 10 && @.inStock)]`. Filters support the comparison operators (`==`, `!=`, `<`, `<=`, `>`, `>=`, plus strict `===`/`!==`), the boolean operators `&&`, `||`, and `!`, and regex matching with `=~ /pattern/flags`.
Everything runs in your browser with a small hand-written evaluator, so your JSON is never uploaded or sent anywhere. That also means it is an independent implementation, not the exact engine from any one library (Jayway, jsonpath-plus, etc.), so a few advanced or vendor-specific features are out of scope: script expressions like `[(@.length-1)]`, parent/sibling operators, and property-name selectors are not supported. For the everyday selectors above, results match what those libraries return.
Use it to debug an API response, prototype a path before wiring it into code, or just understand why a query returns nothing. The output pane shows both the matched values as formatted JSON and the concrete normalized path to each match, which makes it easy to spot when a key is misspelled or an index is off by one.
Frequently asked questions
- What JSONPath syntax does this support?
- The root `$`, child access with `.key` or `['key']`, recursive descent `..`, wildcards `*` and `[*]`, indexes including negatives like `[-1]`, unions like `[0,2]` or `['a','b']`, slices like `[1:3]`, and filters like `[?(@.price < 10)]`. Filters allow `== != < <= > >=`, `&&`, `||`, `!`, and regex with `=~ /pattern/flags`.
- Is my JSON sent to a server?
- No. The tester parses and evaluates everything locally in your browser using JavaScript. Nothing is uploaded, stored, or logged, so you can safely test private or sensitive data.
- Why does my expression return no matches?
- Usually the key is misspelled, the array index is out of range, or a filter condition is false for every item. The tool tells you when the expression is valid but matched nothing, and it prints the exact paths of any matches so you can compare against what you expected.
- Does it work the same as jsonpath-plus or the Jayway library?
- For the common selectors above, yes. It is an independent implementation, so vendor-specific extras like script expressions `[(@.length-1)]`, parent operators, and property-name selectors are not supported. Stick to standard child, wildcard, index, slice, and filter syntax for portable results.
- Can I use filters with strings and regular expressions?
- Yes. You can compare strings with quotes, for example `[?(@.category == 'fiction')]`, combine conditions with `&&` and `||`, and match text with a regex such as `[?(@.name =~ /^A/i)]`.
- What does the 'Matched paths' output mean?
- For every value that matches, it shows the concrete location in bracket notation, like `$['store']['book'][0]['title']`. This resolves wildcards and filters into the specific keys and indexes that were hit, which is helpful for debugging.