JSONPath Selector

Test JSONPath expressions against your own JSON and see the matches right away. Supports recursive descent ($..), wildcards, slices and filters. Results are returned as a JSON array that you can copy or download.

About this tool

What is JSONPath?

JSONPath is a query language for picking values out of a JSON document, in the same way XPath selects nodes in XML. An expression like $.cities[*].name starts at the root ($) and walks down to the values you want. This tool evaluates JSONPath with the jsonpath-plus library so you can check an expression before using it in code, API tests or monitoring rules.

How to use

  1. Paste your JSON into the Input document editor (a small example is filled in to start with).
  2. Type an expression in the JSON path box, for example $..name.
  3. Press Enter or click Select.
  4. The matches appear in the Output document editor as a JSON array. Use Copy to clipboard or Download to take them.

If the JSON is invalid or the expression cannot be parsed, an error is shown. If the expression is valid but nothing matches, you will see "No values matched this path."

Features

  • Evaluates expressions with the jsonpath-plus engine, including filters and slices
  • Separate messages for invalid JSON, invalid expressions and empty results
  • Read-only output editor with syntax highlighting, copy and download

JSONPath syntax cheat sheet

Examples below use this input:

ExpressionMeaningResult
$.cities[0].nameChild access and array index["London"]
$.cities[*].nameWildcard: every element["London", "Rome"]
$..nameRecursive descent: name at any depth["London", "Rome", "United Kingdom"]
$.cities[-1:]Array slice: the last element[{"name": "Rome", ...}]
$.cities[0,1].nameUnion of indexes["London", "Rome"]
$.cities[?(@.population > 5000000)].nameFilter: @ is the current item["London"]
$.cities[*]~Property names (jsonpath-plus extension)[0, 1]

FAQ

Why is the result always an array?

A JSONPath expression can match any number of values, so the tool always returns the list of matches, even when there is only one. An empty array means nothing matched.

Is my JSON uploaded?

No. Parsing and evaluation happen in your browser and nothing is sent to a server.

Does it follow RFC 9535?

It uses jsonpath-plus, which follows the original JSONPath proposal by Stefan Goessner with some extensions (such as ~ for property names). Most everyday expressions behave the same as in RFC 9535, but filter expressions here are written in JavaScript syntax, so edge cases can differ from other implementations.