JSON Path Query — Free Online Tool

JSONPath Explorer

Paste JSON, type a JSONPath expression, and see what it matches. The explorer runs the query with the jsonpath-plus library in your browser, so the JSON stays on the page. Results, paths and the tree update about 300 ms after you stop typing, and Enter runs the query at once.

How this tool handles JSONPath

  • Engine. Queries run through jsonpath-plus. It supports dot and bracket notation, the * wildcard, .. recursive descent, index and slice selectors, index unions such as [0,1], and filters written as [?(...)]. Filters support ==, !=, <, <=, >, >=, && and ||. Regex filters with =~ do not work.
  • Results are always an array with one entry per match, even when there is only one. The Paths tab lists the path of each match in bracket form, such as $['store']['books'][0].
  • Extra operators. ~ returns the property name of each match, and ^ returns the parent value of each match.
  • Errors. Invalid JSON is reported with its line number, such as Line 3: .... A query the engine cannot run shows as a query error, and the results are cleared.
  • Tabs are Results, Paths, Tree, History and Examples. The four example datasets each come with a suggested query. The JSON, the query and the query history are saved in this browser's local storage.

Worked example

Input:

{
  "status": "success",
  "data": {
    "order": {
      "id": "ORD-12345",
      "customer": { "id": 42, "name": "Jane Doe", "email": "jane@example.com" },
      "items": [
        { "sku": "LAP-001", "name": "Laptop", "qty": 1, "price": 999 },
        { "sku": "MOU-003", "name": "Mouse", "qty": 2, "price": 25 }
      ],
      "total": 1049,
      "shipping": {
        "address": { "city": "San Francisco", "zip": "94105" },
        "status": "shipped"
      }
    }
  }
}

Results from the engine:

$.data.order.customer.email           → ["jane@example.com"]
$.data.order.items[*].name            → ["Laptop","Mouse"]
$.data.order.items[?(@.qty > 1)].sku  → ["MOU-003"]
$.data.order..price                   → [999,25]

Gotchas

Regex filters fail. $.data.order.items[?(@.name =~ /^M/)] returns an error, "Invalid left-hand side in assignment". Compare exact values with == instead, or select the names and check them in the Results tab.

Reversed and negative steps return nothing. $.items[::-1] and $.items[2:0:-1] both return []. A single negative index, $.items[-1], also returns []. Use $.items[-1:], which returns the last element in a one-item array.

Quoted unions return nothing. $.store.books[0]['title','price'] returns []. Use separate paths, or an index union such as $.store.books[0,1].price, which returns [8,12] for a list whose first two prices are 8 and 12.

^ is not the key name. $.app.features[?(@.enabled == true)].^ returns the parent object once per match. For the key names, use ~: $.app.features[?(@.enabled == true)]~ returns ["auth","logging"].

Root keys that start with @ fail. On a root object, $['@metadata'] returns an "Unknown value type" error. The same key nested inside another object, as in $.account['@metadata'], works.

Frequently asked questions

Does the explorer send my JSON to a server? No. Queries run in your browser with jsonpath-plus, and nothing is uploaded.

Which JSONPath syntax does it follow? The explorer uses jsonpath-plus, which follows the JSONPath style with extra operators such as ~ and ^. Regex filters and quoted unions do not work in this engine (see the gotchas).

How do I find the path of a value? Open the Paths tab. Each match has its path shown, with a copy button next to it.

Can I load a JSON file? Yes. Use the file upload control, or drop a .json file onto the input editor.