The team behind OnlineTools4Free — building free, private browser tools.
Published Apr 1, 2026 · 7 min read · Reviewed by OnlineTools4Free
JSONPath: Navigate JSON Data Like a Pro
What Is JSONPath?
JSONPath is a query language for JSON data, inspired by XPath for XML. It lets you write expressions that select specific elements from a JSON document — a single value, a list of values matching a pattern, or a filtered subset of an array. Instead of writing code to loop through nested objects and arrays manually, you write a concise path expression and get the matching data back.
The concept was proposed by Stefan Goessner in 2007, and it has since become a widely adopted standard implemented in dozens of programming languages, APIs, and tools. In 2024, IETF published RFC 9535 formalizing JSONPath as an internet standard, which unified the slightly different implementations that had emerged over the years.
A JSONPath expression always starts with $, which represents the root of the JSON document. From there, you navigate using dot notation or bracket notation, much like accessing properties in JavaScript. The expression $.store.book[0].title means: start at the root, go into the "store" object, then into the "book" array, take the first element, and return its "title" property.
Syntax Fundamentals
Dot notation: $.store.book — navigate into nested objects using dots. Each segment after the dot is a property name. This is the most readable form for simple paths.
Bracket notation: $['store']['book'] — equivalent to dot notation but required when property names contain spaces, dots, or special characters. $['first name'] works where $.first name would not.
Array indexing: $.book[0] selects the first element. $.book[-1] selects the last. $.book[0,2,4] selects elements at positions 0, 2, and 4. $.book[1:4] selects a slice from index 1 up to (but not including) index 4.
Wildcards: $.store.* selects all direct children of the store object — every value regardless of key name. $.book[*].author selects the author from every element in the book array.
Recursive descent: $..author searches the entire document tree for any property named "author" at any depth. This is powerful for extracting a specific field from deeply nested or irregularly structured data where you do not know (or do not care about) the exact path.
Filter expressions: $.book[?(@.price < 10)] selects all books with a price less than 10. The @ symbol refers to the current element being evaluated. Filters can use comparison operators (==, !=, <, >, <=, >=), logical operators (&&, ||), and even check for the existence of a property with ?(@.isbn).
Practical Examples
Given an API response containing a list of users with nested address objects:
$.users[*].email — extract all email addresses as a flat list.
$.users[?(@.active == true)].name — get names of only active users.
$.users[?(@.address.country == "US")].id — get IDs of users in the United States.
$.users[0:5] — get the first five users (pagination).
$..phone — find all phone numbers anywhere in the document, regardless of nesting.
These expressions replace what would otherwise be several lines of imperative code. In JavaScript, extracting active user names from a nested response might require response.users.filter(u => u.active).map(u => u.name). The JSONPath equivalent is a single expression that works identically across languages — the same path works in Python, Java, Go, PHP, and Ruby libraries.
JSONPath in Tools and APIs
JSONPath appears in many contexts beyond manual querying. Kubernetes uses JSONPath expressions in kubectl get commands to format output: kubectl get pods -o jsonpath='{.items[*].metadata.name}' lists all pod names. REST API testing tools like Postman use JSONPath to extract values from responses for assertions and variable chaining.
Database systems increasingly support JSONPath. PostgreSQL 12+ includes jsonpath as a native data type with SQL/JSON path language support. MySQL 8.0 supports a subset of JSONPath in its JSON functions. Cloud services like AWS Step Functions use JSONPath for input/output processing between workflow states.
Log analysis and monitoring tools use JSONPath to extract structured fields from JSON log entries. When your application emits structured JSON logs, a JSONPath expression can pull out specific fields (timestamp, error code, user ID) for indexing, alerting, or dashboarding without custom parsing code.
Find JSON Paths Online
Our JSONPath Finder lets you paste a JSON document and write JSONPath expressions to query it interactively. See matching results highlighted in real time as you type your path expression. The tool shows the structure of your JSON as a navigable tree, and clicking any node copies its full JSONPath to your clipboard.
All processing runs locally in your browser — your JSON data stays on your device. Use it to explore API responses, build JSONPath queries for your code, or learn the syntax with immediate visual feedback.
JSON Path Finder
Navigate JSON data interactively and copy JSONPath expressions for any node.
OnlineTools4Free Team
The OnlineTools4Free Team
We are a small team of developers and designers building free, privacy-first browser tools. Every tool on this platform runs entirely in your browser — your files never leave your device.
