JSON Path Tester

Test and evaluate JSONPath expressions against your JSON

Loading editor...
Loading editor...

JSON Path Tester — Test JSONPath Expressions Online

Understanding the Basics

JSONPath is a query language for JSON, analogous to XPath for XML. It was introduced by Stefan Goessner in 2007 and has since become the standard way to extract values from JSON documents in languages and tools including Python's jsonpath-ng, Java's Jayway, and JavaScript's jsonpath-plus. A JSONPath expression always starts with $ (representing the root object) and uses dot notation ($.store.book) or bracket notation ($['store']['book']) to traverse properties. The wildcard operator * selects all children, the recursive descent operator .. searches all descendants regardless of depth, and filter expressions ?() allow conditional selection — for example, $.store.book[?(@.price < 10)] retrieves all books priced below ten. Slice notation [0:3] works like Python slices on arrays. In enterprise application development, JSONPath is a key tool for extracting configuration metrics, handling dynamic workflows, and evaluating assertions without needing to write custom parsing code. It is heavily used in AWS Step Functions state machines, Kubernetes JSONPatch operations, API gateway routing rules, and test assertion libraries. Our tester evaluates expressions using jsonpath-plus, one of the most spec-complete implementations available, and highlights matched nodes directly in the document, which drastically accelerates expression testing and regex-like syntax debugging.

How to Use the Tool

  1. Paste a JSON document into the input editor.
  2. Type your JSONPath expression in the query field (start with $ for the root).
  3. Press Enter or click "Test" — the tool evaluates the expression and highlights matching nodes.
  4. The result panel shows all matched values as a JSON array.
  5. Experiment with dot notation, wildcards, and filter expressions to narrow down your target data.

Key Features & Specifications

  • Evaluates JSONPath expressions using the jsonpath-plus library for maximum spec compliance
  • Supports dot-notation, bracket-notation, wildcards (*), recursive descent (..), and filter expressions ?()
  • Highlights matched nodes visually in the source JSON document
  • Returns results as a JSON array even for single matches for consistent handling
  • Shows the count of matched elements alongside the result

Frequently Asked Questions (FAQ)

Q:What is the difference between $.foo and $..foo?
$.foo selects the "foo" property at the root level only. $..foo uses recursive descent and selects every "foo" property at any depth within the entire document. Use .. when you don't know how deeply nested your target field is.
Q:How do I filter array items by a condition?
Use a filter expression: $[?(@.price < 20)] selects all root-level array items where the price field is less than 20. The @ symbol refers to the current element being evaluated, and you can combine multiple filters using boolean operators like && (AND) and || (OR), such as $[?(@.price < 20 && @.category === "books")].
Q:Is JSONPath standardized?
An IETF standardization effort (RFC 9535) was completed in 2024. Prior implementations varied in edge cases like negative indices and filter semantics. This tool uses jsonpath-plus which aligns closely with the RFC 9535 specification.
Q:Can I select elements by regular expression matches?
Standard JSONPath does not have built-in regex syntax. However, jsonpath-plus supports custom script expressions like $[?(@.name.match(/test/i))] which allows evaluating JavaScript regex matches directly inside filter predicates.