Reference Knowledge Base

What is JSONPath? The Complete RFC 9535 Guide

What JSONPath is: the definition, RFC 9535 standardization, query syntax (root $, recursive .., filter [?()]), and how to test expressions online.

JSONPath is a query language for extracting data from JSON documents, standardized by IETF RFC 9535. The root of a JSON document is represented by $ and paths use dot notation ($.user.name) or bracket notation ($["user"]["name"]) to navigate nested structures.

JSONPath Definition

JSONPath is a declarative query language for JSON, standardized by IETF RFC 9535 (2024). It enables XPath-like navigation of JSON trees without writing imperative traversal code.

Core JSONPath Syntax

  • $ — Root of the document.
  • .key or ["key"] — Access object property.
  • [n] — Access array element at index n (0-based).
  • [*] — Wildcard — all elements or properties.
  • .. — Recursive descent — search all levels.
  • [-1] — Last element in an array.
  • [0,2] — Union — specific indices.
  • [0:3] — Slice — elements from index 0 to 2.
  • [?(@.price < 10)] — Filter expression — elements matching condition.
json
// Sample JSON:
{
  "store": {
    "books": [
      { "title": "Moby Dick", "price": 8.99, "category": "classic" },
      { "title": "Dune",      "price": 12.99, "category": "scifi" },
      { "title": "Hamlet",    "price": 6.99, "category": "classic" }
    ]
  }
}

// JSONPath Queries:
$.store.books[*].title       // All book titles
$.store.books[0].price       // Price of first book: 8.99
$.store.books[-1]            // Last book (Hamlet)
$..price                     // All prices anywhere: [8.99, 12.99, 6.99]
$.store.books[?(@.price < 10)] // Books under $10
$.store.books[?(@.category == "classic")].title // Classic book titles

Try the free JSONPath Tester

Runs entirely in your browser — no upload, no signup, and your data never leaves your device.

Open JSONPath Tester

Frequently Asked Questions

What does $ mean in JSONPath?

The dollar sign ($) represents the root of the JSON document. All JSONPath expressions must start with $.

What is the difference between .. and . in JSONPath?

Single dot (.) accesses a direct child. Double dot (..) is recursive descent — it searches all nested levels for the specified key.

Is JSONPath standardized?

Yes. JSONPath was officially standardized by IETF as RFC 9535 in 2024.

How do I test JSONPath expressions online?

Use our free JSONPath Tester at json2x.com/tools/jsonpath to evaluate expressions against real JSON interactively.

Related JSON Topics & Reference Articles