JSON Pointer · lesson 1 of 6 · Basics

What is a JSON Pointer?

A JSON Pointer (RFC 6901) is a string that names exactly one value in a document. Every step starts with / and is either an object key or an array index.

Examples

Example 1Walk down to one value

Document

{
  "store": {
    "book": [
      { "title": "Moby Dick", "price": 8.99 },
      { "title": "Ulysses", "price": 12.5 }
    ],
    "bicycle": { "color": "red" }
  }
}

Query

/store/bicycle/color
  1. /store Step into the store key.
  2. /bicycle Then into bicycle.
  3. /color Then color — the one value the pointer names → "red".

Result

"red"

Try it in the playground

Good to know

  • The empty pointer (no characters at all) names the whole document.
  • A lone / names the key "" — an empty-string key, which JSON allows.
  • In the playground, a query that starts with / is auto-detected as a JSON Pointer.

About jsonquery

Query, format and learn JSON with jq, JSONPath, JMESPath and JSON Pointer. It is the engine of the desktop app, run in your browser.

Engine
The desktop app’s, compiled to WebAssembly
Licence
MIT (the engine and the app)
Source
GitHub
Contact
The contact form (private)
Public issues
GitHub
Legal
Privacy policy

Known limitations: a file over 10 MB opens read-only and one over 512 MB does not open here; the desktop app has no such limit.