Development and data

How to query a JSON field using paths

A query helps locate values in fictional data without manually traversing the entire document. The result is a list of matches.

Before you start

Text is processed in the browser. Consider the content before using it and read the privacy policy.

Privacy

How to use it

  1. Enter {"users":[{"name":"Ana"},{"name":"Bruno"}]} in the JSON field.

  2. Enter $.users[*].name and run the query.

  3. Change the path to $.users[*].email and query again.

JSON Path Query

Worked example

The wildcard visits the two array elements and selects name. Neither has an email property.

Results: ["Ana","Bruno"] for name and [] for email.

RFC 9535: JSONPath

Limits and checks

This tool implements only a subset: root $, properties, indexes and wildcards. Do not assume support for filters, recursive descent or the whole of RFC 9535. Invalid JSON and unsupported path syntax produce errors; numbers use JavaScript precision, and unsafe integers or non-finite numbers are rejected.

Next step

To review syntax before querying, use JSON Formatter.

How to format and check JSON before sharing it
Back to the blog