JSON Pointer

Resolve an RFC 6901 JSON Pointer against a JSON document.

  • Runs locally in your browser
  • No upload required

Try it

Paste JSON. It is resolved in your browser and never uploaded.

RFC 6901: escape / as ~1 and ~ as ~0. Empty selects the whole document.

Status
Found
Value
"A"

Supported formats

Input
text
Output
text

Privacy

Runs entirely in your browser. Your input is never uploaded, stored, or sent to a third party.

Processing
In your browser
Privacy level
Browser only

Resolved /a/b to a value.

How it works

  • Parsed the JSON document with the verbatim scanner.
  • Decoded each reference token (~1 to / and ~0 to ~).
  • Walked objects by key and arrays by decimal index.
  • An empty pointer selects the whole document; a matched null is a found value.

Methodology

  1. Parse the document with the F054 verbatim scanner.
  2. Split the pointer on / and decode ~1 then ~0 in each reference token.
  3. Walk objects by exact key and arrays by decimal index; report the first failure.

Usage

  1. Paste a JSON document.
  2. Enter a JSON Pointer such as /store/book/0/title, or leave it empty for the whole document.
  3. Run the tool to see the resolved value or a not-found result.

Examples

These are examples, not current values: they use fixed inputs, while the interactive tool computes live results in your browser.

Object member

jsonSelect to copy
{
  "text": "{\"a\":{\"b\":42}}",
  "pointer": "/a/b"
}

Array index

jsonSelect to copy
{
  "text": "{\"items\":[\"x\",\"y\"]}",
  "pointer": "/items/1"
}

Escaped slash

jsonSelect to copy
{
  "text": "{\"a/b\":1}",
  "pointer": "/a~1b"
}

Limitations

Pointer syntax

A JSON Pointer is a sequence of reference tokens separated by /. Each token either names an object member or indexes an array, and ~1 and ~0 escape a slash and a tilde.

Frequently asked questions

How do I reference a key containing a slash?
Escape it: / becomes ~1 and ~ becomes ~0, so the key a/b is referenced as /a~1b.
Why is an empty pointer valid?
RFC 6901 defines the empty string as the whole document, so it always resolves to the root value.
Is my data uploaded?
No. The resolution runs entirely in your browser and is never sent anywhere.

Sources

  1. RFC 6901 — JavaScript Object Notation (JSON) Pointer — IETF
  2. RFC 6902 — JavaScript Object Notation (JSON) Patch — IETF