🔎

JSONPath Online Tester

Pull values out of JSON with expressions, filters and slices
JSONPath 📂 Developer 👤 ToolWorld 🏷️ v1.3.0
Loading...
JSON dataPaste the document to query

Supports .name, [0], [*], [0:2], [-1], ..key and filters such as [?(@.price < 10)].

MatchesPath and value

Enter content, then press Query

Query info

Enter content, then press Query

How to Use

📖 Overview


When an API returns a large nested document and you want four fields out of it, writing loops that walk down each level is verbose and easy to get wrong when an array is shorter than you assumed. JSONPath describes the route in a single expression: every book title, every price, every item cheaper than ten. It reads far better than the traversal it replaces. This tool takes JSON on the left and an expression on the right, then lists every match with its path and its value, so if you are unsure whether an expression is right you can see the hit count immediately and adjust. Dot notation and bracket notation both work, as do wildcards, slices with a colon, negative indices counted from the end, and filters carrying a comparison. It also ships a row of quick buttons holding the expressions people reach for most, which saves typing them from memory. Parsing and evaluation are entirely local, so the document you paste is never uploaded.

✨ Features


  • Both dot notation and bracket notation for keys, the latter for names containing special characters
  • Indices support positive values, negative values counted from the end, the star wildcard, comma unions and colon slices
  • Recursive descent with a double dot, so you can find a key at any depth without counting levels
  • Filters support six comparisons: equals, not equals, less than, greater than, less or equal, greater or equal, over strings and numbers alike
  • Common expressions sit on quick buttons that fill the input in one click instead of being typed from memory
  • Results list the path and value of every match, and beyond 200 hits only the first 200 are rendered with the total stated

🚀 How to use


  1. Paste your JSON into the input box, or load the sample to try it on the bundled data
  2. Type a path beginning with the root symbol, or click any of the quick buttons underneath
  3. Press Query to see what matched
  4. Check the hit count on the right: a zero means either the path is written wrong or the data does not contain it
  5. Copy the result in one click; what lands on the clipboard is each matched value serialised as JSON

⚠️ Notes


  • The expression must start with the root symbol: anything else is rejected with a message, and the shorthand that omits it is not supported
  • A subset, not the whole grammar: dots, indices, wildcards, slices, unions, recursion and simple filters are supported; script expressions and complex boolean combinations are out of scope
  • The JSON must be valid: pasted content is parsed first and a failure is reported, so no half-parsed document is ever matched against
  • Filter fields must exist: a field that cannot be read counts as no match rather than raising an error or producing a false hit
  • Empty input gives no result: if either the document or the expression is blank you are prompted to fill it in, and editing either one after a run clears the result until you press Query again, so the table never shows matches from an expression you have since changed

Related

⏫︎