Data Formats

JSONPath Evaluator

Run JSONPath expressions against a document and see every match highlighted.

  • History kept on this deviceRecent results are kept in this browser's local storage until you clear them.
  • Runs in your browserProcessing happens in this page. No application server receives your input.
Script expressions such as [(...)] are not supported. A filter such as [?(@.price<10)] always runs in the background, and can call only match, includes, startsWith, endsWith, indexOf, lastIndexOf, toLowerCase, toUpperCase and trim.

Document

Matches

Enter a document and an expression, then press Evaluate.

What this tool does

Evaluate runs a JSONPath expression against a JSON document and lists every match with its concrete path, and the document is shown as a tree with the matched nodes marked. For example, $.store.book[*].author over the bookstore document lists four rows:

  • $['store']['book'][0]['author'] is "Nigel Rees"
  • $['store']['book'][1]['author'] is "Evelyn Waugh"
  • $['store']['book'][2]['author'] is "Herman Melville"
  • $['store']['book'][3]['author'] is "J. R. R. Tolkien"

Copy copies a compact JSON array of the paths and values. Everything runs in your browser, and nothing in the document or the expression is sent anywhere.

What it does not do

It does not read YAML, repair broken JSON, edit the document, keep saved queries, offer a download, evaluate as you type, or claim conformance with RFC 9535. Evaluate runs when you press it, or press Enter in the expression field.

Expressions and filters

  • Script expressions such as $..[(@.length-1)] are not supported, and are refused before anything runs.
  • A filter such as [?(@.price<10)] uses the library's non-evaluating path: it is read by a parser, and no code is generated from it. This is risk reduction, not a guarantee: an expression can still be slow.
  • A filter can call only match, includes, startsWith, endsWith, indexOf, lastIndexOf, toLowerCase, toUpperCase and trim. Any other call, an assignment, and a call written @["push"](9) are refused before the library runs.
  • A filter over a field that can be missing needs a guard: write @.isbn && @.isbn.includes("0"), because one node without the field fails the whole run.
  • A filter over a plain value is written @ >0, with the space, because the library rewrites @ only before a dot, a space, a closing parenthesis or a bracket.
  • A nested filter, or a quoted string that starts with (, is refused.
  • A filter reads inherited names, so [?(@.toString)] matches every object. Nothing is called or written.

Forms

  • Write [-1:] for the last element: [-1] is not supported.
  • Write [?(...)] for a filter: [?...] is not supported.
  • A key with a space needs the quoted form, $['a b'].
  • A key that is empty, holds ], [, ;, ^, a comma or a quote, or is named like an operator, cannot be named in an expression. $.* still lists it, and an empty key reads "" in the tree.

Reading results

  • A matched node is highlighted by text, not by color: its type reads the word match, and an ancestor reads how many matches lie below it.
  • $.length over an array or a string is a row of the table with the JavaScript length, and it marks nothing in the tree.
  • The dialect is the library's and not RFC 9535, so slices follow it: $.a[1:0] reads an end of 0 as no end, and returns every element from index 1.
  • A key named ~, ^ or like @x() is listed by $.*, but the library prints no segment for it, so its path stops short and it is not marked in the tree.
  • A key holding ' or [( cannot be named, $.* still lists it, and the path it prints does not run again if you paste it.
  • A repeated key keeps its last value, and each repeat is listed as a warning.
  • Integers beyond 2^53 are evaluated as JSON.parse reads them, so they lose precision.
  • A document of null, false, 0 or "" is valid: $ gives one match and any other expression gives none.
  • $..@number() lists nothing, while $..*@number() lists the numbers.

Limits

BoundValueAt the bound
Document size16.0 MBRefused before anything is read
Expression length4,096 bytesRefused before the library runs
Nesting depth64 levelsRefused, with the position
Keys200,000Refused
Matches100,000Refused, with no partial list
Output size16.0 MBRefused
Worker time30 secondsStopped, in the background only
Listed repeated keys1,000The rest are counted
Path length500 charactersCut in the table, whole when copied
Value cell500 charactersCut in the table, whole when copied
Tree children1,000 per nodeA last node counts the rest and their matches
Tree nodes20,000The tree is partial, and says so
Tree paths8,000,000 characters in allThe tree is partial, and says so
Tree label500 charactersCut with an ellipsis
Tree value length200 charactersCut with an ellipsis

What runs in the background

  • A filter always runs in the background, whatever the size of the document.
  • An expression that can multiply its results, such as a union, a parent step or a second .., runs in the background too.
  • A document of 8.0 KB or more runs in the background too.
  • Cancel stops a run in the background. It appears only while one is running.

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.