JSON Pointer explorer
Browse a JSON document as a tree, click any value and copy its JSON Pointer (RFC 6901), URI fragment, JSONPath and jq path, or type a pointer to find the value it points to. Runs in your browser.
Last updated
What it does
- Shows a JSON document as a tree. Click any value to get its JSON Pointer (
/replicas/0/zone), the URI fragment form used in$ref(#/replicas/0/zone), a JSONPath expression ($.replicas[0].zone) and a jq path (.replicas[0].zone), each ready to copy. - Works the other way too: type or paste a pointer and the tree opens to the value it points to. If it doesn't resolve, it says where it stopped and what keys exist there.
- Keeps numbers exactly as written, so long IDs aren't rounded, and shows large arrays a hundred items at a time.
How JSON Pointers work
A JSON Pointer (RFC 6901) is a list of keys and array indexes, each starting with /. The empty pointer means the whole document. Two characters are escaped inside a key: ~ becomes ~0 and / becomes ~1, so the key feature/flags is written /env/feature~1flags.
Pointers are used in JSON Patch (RFC 6902), JSON Schema and OpenAPI $ref values (as #/components/schemas/Pet), and in API error responses that point at the invalid field.
Questions
- What is the difference between a JSON Pointer and JSONPath?
- A JSON Pointer names exactly one location and has no wildcards or filters. JSONPath is a query language that can match many values (
$..price,$.items[?(@.qty > 1)]). Use pointers where a single, exact location is required, such as JSON Patch and$ref. - Are array indexes zero-based?
- Yes.
/items/0is the first item. A pointer can't count from the end; JSON Patch uses-only to mean "append" when adding. - Is my JSON uploaded?
- No. Parsing and the tree run in your browser.