# JSONPath

**JSONPath** is a string syntax for selecting and extracting values from within a JSON (RFC 8259) document, standardized by the IETF as RFC 9535, a Proposed Standard published in February 2024.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> Originally proposed by Stefan Gössner in 2007 as "XPath for JSON", the IETF charter for the JSONPath Working Group noted 39 or more mostly compatible implementations in various languages.<sup>[2](https://www.ietf.org/blog/jsonpath-rfc/)</sup>

| Key fact | Detail |
|---|---|
| Standard | RFC 9535, Proposed Standard, February 2024; editors S. Gössner (Fachhochschule Dortmund), G. Normington, and C. Bormann (Universität Bremen TZI)<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> |
| Origin | Blog post "JSONPath – XPath for JSON" by Stefan Gössner, September 2007; the IETF charter noted 39 or more mostly compatible implementations<sup>[2](https://www.ietf.org/blog/jsonpath-rfc/)</sup> |
| Result model | A query applied to a JSON value (the query argument) produces a nodelist of zero or more nodes<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> |
| Core selectors | Name (`'name'`), index (`3`), wildcard (`*`), array slice (`start:end:step`), and filter (`?<logical-expr>`)<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> |
| Number range | Integers relevant to processing must lie in [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1], the I-JSON exact-integer interval<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> |
| Extension point | Function extensions with a registered name, declared parameter and return types, and a side-effect-free evaluation requirement<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> |
| Distinction from JSON Pointer | JSON Pointer (RFC 6901) resolves to exactly one value; JSONPath is a query language returning 0 or more values<sup>[3](https://jsonic.io/guides/json-pointer)</sup> |

## Purpose and history

Stefan Gössner, a lecturer at Fachhochschule Dortmund, published "JSONPath – XPath for JSON" in September 2007, proposing a path expression syntax that would select parts of JSON structures the way XPath expressions select nodes of XML documents, covering only essential parts of XPath 1.0 and staying close to C-family language conventions.<sup>[4](https://goessner.net/)</sup><sup> • </sup><sup>[5](https://goessner.net/articles/JsonPath/index)</sup> The syntax spread widely but never had an official specification; the IETF charter for the JSONPath Working Group noted 39 or more implementations that were mostly compatible but differed in certain behaviors.<sup>[6](https://datatracker.ietf.org/group/jsonpath/about/)</sup>

The IETF JSONPath Working Group, chaired by James Gruessing and Tim Bray with area director Francesca Palombini, developed the standards-track specification from the common semantics of existing implementations, choosing by rough consensus where implementations disagreed.<sup>[6](https://datatracker.ietf.org/group/jsonpath/about/)</sup> RFC 9535 was published on 21 February 2024, over 16 years after the original blog post, and the working group has since concluded.<sup>[2](https://www.ietf.org/blog/jsonpath-rfc/)</sup><sup> • </sup><sup>[6](https://datatracker.ietf.org/group/jsonpath/about/)</sup> The same working group also delivered RFC 9485, I-Regexp, an interoperable regular expression format.<sup>[6](https://datatracker.ietf.org/group/jsonpath/about/)</sup>

## Syntax and semantics

A JSONPath expression is applied to a JSON value, the query argument, and outputs a nodelist. The expression consists of a root identifier followed by zero or more segments, each containing one or more selectors.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

**Identifiers and segments.** The root identifier `$` refers to the whole query argument; the current node identifier `@` refers to the node under evaluation inside a filter expression. Segments select children (`[<selectors>]`) or descendants (`..[<selectors>]`) of an input value. Bracket notation such as `$['store']['book'][0]['title']` is canonical; dot notation such as `$.store.book[0].title` is a shorthand defined in terms of it, usable only for member names composed of certain characters.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

**Selectors.** A name selector picks a named child of an object, an index selector picks an indexed child of an array, and the wildcard `*` selects all children of a node (or, as `..[*]`, all descendants). An array slice `start:end:step` selects a series of elements, giving a start position, an end position, and an optional step. A filter expression `?<logical-expr>` selects certain children of an object or array, for example `$.store.book[?@.price < 10].title`. A query by itself in a logical context is an existence test, true when it selects at least one node.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

**Well-formedness and validity.** A query must be encoded in UTF-8 and conform to the ABNF grammar to be well-formed; it is valid if it also meets two semantic requirements, including that integers relevant to processing lie within the I-JSON exact-integer interval [-(2<sup>53</sup>)+1, (2<sup>53</sup>)-1].<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> A singular query is an expression syntactically restricted so that, regardless of input, it produces a nodelist of at most one node; a Normalized Path is a syntactically defined form of expression that identifies exactly one node, similar to but syntactically different from JSON Pointer.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

**Ordering.** Children of an array appear in the result ordered by array position; the order of children of an object is not stipulated, because JSON objects are unordered. Behavior also becomes unpredictable when the query argument contains duplicate member names within one object, a non-interoperable construct under RFC 8259.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

## Function extensions

RFC 9535 defines an extension point for adding filter-expression functionality. A function extension has a unique registered name, declared types for its return value and parameters, and must be defined so its evaluation is free of side effects: all evaluation orders and short-circuit choices must yield the same result. New functions are registered in the IANA "Function Extensions" subregistry.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup> Implementations provide the predefined functions, which include `length()`, `count()`, `match()`, `search()`, and `value()`.<sup>[7](https://github.com/davidhoo/jsonpath)</sup>

## Relationship to other standards

JSON Pointer (RFC 6901, April 2013) identifies a specific value within a JSON document and always resolves to exactly one value or an error; JSONPath instead queries a document and can return multiple values, with wildcards, filter expressions, and recursive descent that JSON Pointer lacks.<sup>[8](https://www.rfc-editor.org/rfc/rfc6901.html)</sup><sup> • </sup><sup>[3](https://jsonic.io/guides/json-pointer)</sup> The IETF charter framed the two as complementary: JSON Pointer for referencing a single specific part, JSONPath for querying.<sup>[6](https://datatracker.ietf.org/group/jsonpath/about/)</sup>

The RFC deliberately departs from older implementations where needed. Early JSONPath delegated parts of a query to the underlying runtime, such as JavaScript's `eval()`, and regular expression processing was often delegated to whatever engine was convenient, making expressions decreasingly portable. RFC 9535 removes these implementation-specific dependencies, and its design principle accepts a rough consensus between implementations even where backwards compatibility is not achieved.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

## Implementations and testing

A community Compliance Test Suite tests implementations against RFC 9535 and is designed to be embedded as a git submodule.<sup>[9](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite)</sup> Compliant implementations now exist across languages, including Go (one implementation reports passing all 703 compliance tests), Rust, PHP, TypeScript, Zig, Java, and [JavaScript](https://www.edgepedia.org/javascript).<sup>[7](https://github.com/davidhoo/jsonpath)</sup><sup> • </sup><sup>[10](https://github.com/topics/rfc9535)</sup> The Kubernetes `kubectl` tool supports JSONPath templates as an output format, with extensions such as `range`/`end` iteration and negative slice indices, though it does not support regular expressions in JSONPath filters.<sup>[11](https://kubernetes.io/docs/reference/kubectl/jsonpath/)</sup>

## Security considerations

RFC 9535 identifies three classes of attack. First, implementations that historically fed parts of a query to a language engine such as JavaScript's `eval()` are exposed to injection attacks; the RFC requires implementations to parse the entire query syntax themselves. Second, availability attacks can exploit unusually expensive runtime behavior: crafted queries or query arguments can trigger surprisingly high, possibly exponential, CPU usage, or stack overflow through a naive recursive implementation of the descendant segment, so resource management is needed. Third, when JSONPath is used inside a security mechanism, attackers can exploit unpredictable behavior or differences between implementations, particularly with query arguments that use non-interoperable JSON constructs.<sup>[1](https://www.rfc-editor.org/rfc/rfc9535.html)</sup>

## References

1. [RFC 9535: JSONPath: Query Expressions for JSON, IETF (February 2024)](https://www.rfc-editor.org/rfc/rfc9535.html)
2. [JSONPath: from blog post to RFC in 17 years, IETF blog (21 February 2024)](https://www.ietf.org/blog/jsonpath-rfc/)
3. [JSON Pointer (RFC 6901): Syntax, Escaping, and JavaScript Resolution, Jsonic](https://jsonic.io/guides/json-pointer)
4. [Stefan Gössner, personal site](https://goessner.net/)
5. [JSONPath – XPath for JSON, Stefan Gössner (2007)](https://goessner.net/articles/JsonPath/index)
6. [Concluded WG JSON Path (jsonpath), IETF Datatracker](https://datatracker.ietf.org/group/jsonpath/about/)
7. [Go JSONPath, RFC 9535-compliant implementation, GitHub](https://github.com/davidhoo/jsonpath)
8. [RFC 6901: JavaScript Object Notation (JSON) Pointer, IETF (April 2013)](https://www.rfc-editor.org/rfc/rfc6901.html)
9. [JSONPath Compliance Test Suite, GitHub](https://github.com/jsonpath-standard/jsonpath-compliance-test-suite)
10. [rfc9535 topic, GitHub](https://github.com/topics/rfc9535)
11. [JSONPath Support, Kubernetes documentation](https://kubernetes.io/docs/reference/kubectl/jsonpath/)

---
*Topic: Encyclopedia › Technology and the built world › Computing and digital systems › Software and programming › Data formats and serialization*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 11, 2026; Oct 15, 2026; Oct 25, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
