Test JSONPath expressions against JSON data with real-time result display
json.parse() in code gives you the whole object, JSONPath lets you surgically extract exactly the data you need: $.store.book[*].title extracts all book titles from a bookstore JSON in a single expression, equivalent to data.store.book.map(b => b.title) in JavaScript. JSONPath is widely used in API testing, data transformation pipelines, configuration management, and no-code/low-code platforms.$.store.book) for direct child access, bracket notation ($['store']['book']) for keys with special characters, wildcard (*.price) to match any key, array slice ([0:3] for first three elements, [-3:] for last three), recursive descent ($..author to find all 'author' keys at any nesting depth), union selector ([0,2,4] for specific indices), filter expressions ([?(@.price < 10)] to filter by child values, supporting comparison operators == != < <= > >= and logical operators && ||), and the current node reference (@ within filter expressions).Each JSON query language serves different needs and ecosystems. <strong>JSONPath</strong> (RFC 9535, standardized 2024) is the most widely implemented — supported in JavaScript, Java (Jayway JsonPath), Python (jsonpath-ng), .NET, and testing tools like Postman and Karate. It's the safe default choice for cross-platform JSON querying. <strong>jq</strong> is a full programming language for JSON transformation with its own unique syntax — far more powerful than JSONPath (supports variables, functions, arithmetic, string manipulation, conditionals) but requires installing the jq binary and learning a new language. Use jq for complex CLI data processing; use JSONPath for simpler extraction within application code. <strong>JMESPath</strong> (AWS's query language) is similar in expressiveness to JSONPath but uses function-call syntax (<code>sort_by(contents, &date)</code>) rather than bracket-filter syntax; it's the standard in AWS CLI and SDKs. <strong>JSON Pointer</strong> (RFC 6901) is the simplest — it only supports exact path access like <code>/store/book/0/title</code> with no wildcards or filters; used primarily in JSON Schema and JSON Patch. The PivaBox JSONPath Tester helps you learn and debug JSONPath expressions with instant feedback — all processing happens in your browser.
Filter expressions are JSONPath's most powerful feature — they select array elements based on conditions evaluated against each element. The syntax is <code>[?(expression)]</code> where <code>@</code> refers to the current element being tested. Examples: <code>$.store.book[?(@.price < 10)]</code> — all books cheaper than
Standard JSONPath (RFC 9535) is a <strong>read-only query language</strong> — it selects and extracts data but does not modify it. This mirrors the original design philosophy: JSONPath locates nodes, and your application code decides what to do with them. However, several implementations add mutation capabilities as extensions: <strong>jsonpath-plus</strong> (the library used by this tool) supports a <code>JSONPath({path, json, callback})</code> mode where you pass a callback function that receives each matched value and can return a modified value. In practice, most JSON modification is done in application code: (1) Parse JSON into native objects, (2) Navigate to the target location (optionally using JSONPath to find it), (3) Mutate the object directly, (4) Serialize back to JSON. For declarative JSON transformation, consider <strong>jq</strong> (which is explicitly designed for transformation) or <strong>JSON Patch</strong> (RFC 6902) which defines a standardized format for describing JSON modifications as a sequence of operations (add, remove, replace, move, copy, test). The PivaBox JSONPath Tester focuses on the query/selection use case — all evaluation runs client-side in your browser.