JSONPath and object-path online evaluator

Extract values from JSON data using JSONPath or object-path syntaxes in an online editor and view the results in real-time

Supports both JSONPath-plus and object-path syntaxes. Examples: $.property.value or property.value

About this tool

This online tool allows you to extract values from JSON data using JSONPath or object-path syntaxes. The extracted content is updated in real time as you type your path.

This playground uses the same logic as the Mockoon features that support JSONPath and object-path syntaxes:

About JSONPath

JSONPath is a query language for JSON data. It allows you to analyze, transform, and extract data from JSON documents.
JSONPath is used in many programming languages and data processing tools. It is similar to XPath for XML documents.

Syntax cheat sheet

SymbolDescription
$the root object/element
@the current object/element
. or []child operator
..nested descendants
*wildcard, all objects/elements regardless of their names
[]subscript operator
[,]JSONPath allows alternate names or array indices as a set.
[start:end:step]array slice operator
?()applies a filter (script) expression

JSONPath examples

Copy
{ "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } }
JSONPathResult
$.store.book[*].authorthe authors of all books in the store
$..authorall authors
$.store.*all things in store, which are some books and a red bicycle
$.store..pricethe price of everything in the store
$..book[2]the third book
$..book[(@.length-1)]
$..book[-1:]
the last book in order
$..book[0,1]
$..book[:2]
the first two books
$..book[?(@.isbn)]filter all books with isbn number
$..book[?(@.price<10)]filter all books cheapier than 10
$..* All members of JSON data item

About object-path

object-path is a simpler library to access and manipulate properties on objects using paths. It is similar to JSONPath but less powerful and more straightforward to use.
object-path is mainly using the dot and bracket notations to access nested properties. However, it doesn't support all the features of JSONPath.

object-path examples

Copy
{ "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.95 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.99 } ], "bicycle": { "color": "red", "price": 19.95 } } }
object-pathResult
store.bookthe books in the store, which are an array of objects
store.bicycle.colorthe color of the bicycle
store.book[0].authorthe author of the first book
store.book[1].titlethe title of the second book