About this tool
JSONPath picks values out of JSON with a short expression, such as $.store.books[*].title. Type a query and see the matches as you go, along with each match's normalized path. The parser follows RFC 9535 and never evaluates code, so filters can't run scripts.
How to use it
- Paste JSON or import a file.
- Type a query starting with $.
- Choose whether to see values, paths or both.
Example
{"books":[{"title":"Clean Code","price":8.99},{"title":"Refactoring","price":32}]}[ "Clean Code" ]
Query: $.books[?@.price < 10].title
Questions
- Which syntax is supported?
- Member names (.name and ['name']), wildcards (*), indexes including negative ones, slices ([1:3], [::-1]), recursive descent (..), and filters with comparisons, &&, || and !. Function extensions such as length() aren't supported yet.
- What do filters look like?
- Use ?@ for the current item, as in $.books[?@.price < 10]. You can combine tests, as in [?@.inStock && @.price < 10], or check that a field exists with [?@.isbn].
- Is this safe with untrusted expressions?
- Yes. Some JSONPath libraries evaluate filters as JavaScript, which has led to security flaws. Here, expressions are parsed and interpreted, so they can only read data.