Home → JSON Pointer RFC 6901 Online
Resolve JSON Pointer expressions to navigate to any value in a JSON document.
Resolve JSON Pointer expressions to navigate to any value in a JSON document. This tool runs entirely in your browser — no data is ever sent to a server. Free to use, no account required.
JSON Pointer is a string syntax for precisely identifying a single value within a JSON document, defined in RFC 6901.
A pointer starts with / and each segment separated by / refers to an object key or array index. The empty string "" refers to the whole document. For example: /users/0/email points to the email key of the first user object.
Two characters need escaping: forward slash / becomes ~1, and tilde ~ becomes ~0. This allows any key name to be expressed as a JSON Pointer regardless of its content.
Both JSON Pointer and JSONPath navigate JSON documents, but they have fundamentally different capabilities and use cases.
JSON Pointer is the right choice for precise, unambiguous reference to exactly one value. It is used in JSON Patch (RFC 6902) for specifying operation targets and in JSON Schema for $ref references.
JSONPath is more powerful: it supports wildcards, filters, recursive descent, and can return multiple matching values. Use JSONPath for queries and data extraction tasks; use JSON Pointer for exact single-value addressing.
JSON Pointer (RFC 6901) is a string syntax for identifying specific values within a JSON document. It's used by JSON Patch, OpenAPI $ref, and many query libraries.
// JSON Document
{
"store": {
"book": [
{"title": "JSON Basics", "price": 9.99},
{"title": "Advanced Go", "price": 14.99}
],
"name": "Tech Books"
},
"version": 2
}
// Pointer Examples
"" → entire document
"/version" → 2
"/store/name" → "Tech Books"
"/store/book/0" → {"title":"JSON Basics","price":9.99}
"/store/book/1/title" → "Advanced Go"
"/store/book/-" → (append to array in Patch operations)
| Escape | Meaning |
|---|---|
| ~0 | Literal tilde character (~) |
| ~1 | Literal forward slash (/) |
| None needed | All other characters used as-is |
// Evaluate JSON Pointer manually
function getByPointer(obj, pointer) {
if (pointer === "") return obj;
return pointer.slice(1).split("/").reduce((cur, key) => {
key = key.replace(/~1/g, "/").replace(/~0/g, "~");
return cur[key];
}, obj);
}
getByPointer(doc, "/store/book/0/title"); // "JSON Basics"
// npm: json-pointer library
const jp = require("json-pointer");
jp.get(doc, "/store/book/1/price"); // 14.99
Every JSON Pointer is either an empty string (pointing to the root document) or a sequence of /-prefixed reference tokens. Special characters ~ and / inside key names must be escaped.
| Pointer | Points To | Notes |
|---|---|---|
| (empty string) | Entire document | Root reference |
| /name | Top-level "name" key | Must start with / |
| /address/city | Nested property | Each / is a level |
| /items/0 | First array element | Arrays use 0-based index |
| /items/2 | Third array element | |
| /items/- | Element after last | Used in JSON Patch "add" |
| /a~0b | Key named "a~b" | ~ escapes ~ as ~0, / as ~1 |
| /m~1n | Key named "m/n" | Forward slash escaped as ~1 |
// JSON Pointer evaluation (RFC 6901)
const doc = {
"foo": ["bar", "baz"],
"": 0,
"a/b": 1,
"c%d": 2
};
// Pointer → Value
// "" → entire document
// "/foo" → ["bar","baz"]
// "/foo/0" → "bar"
// "/foo/1" → "baz"
// "/" → 0 (empty string key)
// "/a~1b" → 1 (key "a/b", / escaped as ~1)
JSON Pointer and JSONPath both navigate JSON documents but serve different purposes. Pointer identifies a single location; JSONPath queries multiple values with wildcards and filters.
| Feature | JSON Pointer (RFC 6901) | JSONPath |
|---|---|---|
| Syntax | /key/subkey/0 | $.key.subkey[0] |
| Multiple matches | No — always one value | Yes — wildcards and filters |
| Wildcards | No | Yes ([*], ..) |
| Filter expressions | No | Yes ([?(@.x > 0)]) |
| Standard | IETF RFC 6901 | RFC 9535 |
| Used by | JSON Patch, JSON Schema, APIs | Data extraction, querying |
| Best for | Precise single-value access | Querying multiple values |
Explore more tools: All JSON Tools | Validator | Pretty Print | JSON Diff