JSONPath cheatsheet
$— root.fieldor['field']— child..field— recursive descent[*]— all elements[0],[-1],[0:3]— index / slice[?(@.price < 40)]— filter
FAQ
- JSONPath vs JSON Pointer?
- JSON Pointer (
/store/books/0) addresses one node. JSONPath ($.store.books[*]) is more like XPath — supports filters, recursive descent, wildcards. - What's <code>$..tags[*]</code>?
- Recursive descent for "tags" anywhere in the document, then expand each match. Handy when nested objects have tag arrays at varying depths.
- Does this match the IETF RFC?
- Powered by jsonpath-plus, which targets the de facto Goessner / Stefan flavour. The official IETF JSONPath is mostly compatible but stricter.
- Can I extract values, not just nodes?
- You're already extracting values — the output is the matched values. For path-string output, use jsonpath-plus library directly with
resultType: "path".
Related tools
- JSON Formatter / Minifier / Validator
Pretty-print, minify, or validate JSON. Strict spec — catches trailing commas, unquoted keys, comments at the source.
- JSON ↔ YAML
Convert between JSON and YAML losslessly, preserving scalar types and structure.
- JSON ↔ CSV
Convert between flat JSON arrays and CSV / TSV — RFC 4180 quoting via PapaParse.