b2KIT

JSONPath Tester

Test JSONPath expressions against JSON data with real-time result highlighting and path builder.

Tested tool guide Tested browser tools Checked August 16, 2026

What JSONPath Tester does, with a checked example

A JSONPath expression asks a structural question of a JSON document: which values occur at the locations described by this path? Paste JSON, enter or build an expression, and the tester updates the matched result while highlighting the corresponding locations. It is useful for checking root selection, nested object members, array indexes, and wildcards before placing a query in code. The common surprise is that a JSONPath query conceptually returns a list of matched nodes, even when it appears to name one value. One matched node containing an array is not the same outcome as several separate matches.

Worked example

A concrete input and expected output from the current implementation.

Input

JSON:
{"orders":[{"id":"A1"},{"id":"B2"}]}

JSONPath:
$.orders[*].id

Expected output

[
  "A1",
  "B2"
]

The root member `orders` is an array. The wildcard selects both order objects in document order, and the final `id` selector produces the two string values shown.

How the result is produced

1

Expression evaluation

The JSON text supplies the document, and `$` denotes its root. Each following segment selects nodes: a member name selects an object value, an integer index selects an array item, and `*` selects all children at that segment. As either input changes, the tester reevaluates the expression and refreshes the result highlighting, allowing an incorrect or overbroad path to be corrected immediately.

2

Path construction

The path builder helps assemble a definite route to an existing nested value, especially where array indexes or object member quoting are easy to mistype. That route is still a JSONPath query, so compare it with a broader form when you need multiple nodes. Evaluating the path does not rewrite, filter in place, or delete the pasted JSON.

Good uses

  • Confirm that `$.response.items[*].id` extracts every identifier from a captured API response before using the expression in application code.
  • Debug a failing fixture assertion by testing whether its query reaches the intended nested branch or stops at a missing member.
  • Build a correctly quoted path for JSON keys containing spaces, periods, or punctuation, then verify which value that path actually selects.

Limits and checks

  • Do not treat acceptance as universal compatibility. RFC 9535 defines JSONPath, but runtimes can still differ, particularly when they implement older syntax or extra operators. Verify filters, functions, and extensions with the same JSONPath implementation that will execute the production query.
  • An empty match set, one match whose value is `null`, and one match whose value is an empty array are distinct. Rendered brackets can be easy to misread. Check both the matched locations and their values before concluding that a field is absent.
  • Dot notation splits a path into member segments. For `{"a.b": 1}`, `$.a.b` asks for `b` beneath `a`; it does not select the literal key `a.b`. Use a quoted name selector such as `$['a.b']` when the period belongs to the member name.

Common questions

Why does selecting an array differ from selecting its elements?

`$.items` matches one node: the array stored in `items`. `$.items[*]` matches each child of that array. Those queries can involve the same underlying values but have different match structures, which matters when consuming code expects one array value rather than a list of individual item values.

Is a JSONPath expression the same as a JSON Pointer?

No. JSON Pointer is a slash-delimited syntax for identifying a particular value, while JSONPath is a query syntax whose selectors can match multiple nodes. A pointer such as `/orders/0/id` and a path such as `$.orders[0].id` may identify the same value, but the formats are not interchangeable.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools