JSON Toolbox LogoJSONToolbox

JSONPath Tester

Evaluate JSONPath expressions against JSON data in your browser. Query nested objects and arrays, test selectors, inspect matching values and paths, and copy the results for API debugging, configuration work, and data-processing tasks.

Common paths:
Matching values and paths will appear here...
All processing happens in your browser. No JSON is sent to our servers.

Key Features

Evaluate JSONPath Expressions

Run a JSONPath expression against a parsed JSON document and inspect the values selected by the current evaluator.

Inspect Matching Values

View the number of matches and the extracted values returned by the expression. Results should remain distinguishable even when multiple matches contain identical data.

Show Match Paths

Each result shows its JSONPath, the equivalent JSON Pointer (RFC 6901), and the node type, so you can locate the match in the source document or in another tool.

Common JSONPath Syntax

Use the root selector, child properties, bracket notation, array indexes, wildcards, recursive descent, and simple comparison filters. Slices, unions, regular expressions, and functions are not supported.

Syntax Reference

Open the built-in reference to review the operators this evaluator supports, with examples you can copy into the expression field.

Copy Query or Results

Copy the tested expression, matched values, paths, or result JSON for use in API tests, scripts, configuration, documentation, or debugging.

Browser-Based Evaluation

JSON parsing and JSONPath evaluation happen in your browser. The page does not require an account or upload your document to a remote service.

How to Use

1

Enter valid JSON

Paste an API response, configuration document, export, or other valid JSON into the input editor. The JSON must parse successfully before a query can run.

2

Write a JSONPath expression

Start with the root selector $, then add properties, indexes, wildcards, recursive selectors, slices, or filters supported by the current evaluator.

3

Evaluate the expression

Click Evaluate to run the query. The result distinguishes a valid expression with no matches from an expression that cannot be parsed or is not supported.

4

Inspect values and locations

Review each matched value together with its concrete path and, when available, its JSON Pointer or node type.

5

Copy and refine

Copy the expression or selected results for use in code and refine the query incrementally until it returns exactly the nodes you need.

JSONPath Query Example

Use a JSONPath expression to select the title of the first book and compare it with a wildcard query.

Input
{
  "store": {
    "book": [
      {
        "title": "Sayings of the Century",
        "price": 8.95
      },
      {
        "title": "Sword of Honour",
        "price": 12.99
      }
    ]
  }
}
Output
[
  {
    "path": "$.store.book[0].title",
    "value": "Sayings of the Century"
  }
]

How to Test JSONPath Expressions Online

What Is JSONPath?

JSONPath is a query syntax for navigating and selecting data from JSON documents. It is commonly used to find nested properties, array items, matching records, and values inside API responses or configuration files.

JSONPath implementations are not all identical. Some tools follow the newer IETF JSONPath RFC 9535, while others implement older or library-specific dialects. A reliable tester should identify the syntax it supports rather than implying that every JSONPath expression works everywhere.

How to Use a JSONPath Tester

  1. Enter JSON: Paste a valid JSON object or array into the document editor.
  2. Write an expression: Start with $ and add property names, array indexes, wildcards, recursive selectors, slices, or filters supported by the evaluator.
  3. Evaluate: Run the query against the parsed document.
  4. Classify the result: Determine whether the expression is invalid, valid but has no matches, or returns one or more nodes.
  5. Inspect paths: Review the concrete path, JSON Pointer, value, and node type when available.
  6. Copy the query: Reuse the tested expression in application code, API tests, a pipeline, or documentation.

Common JSONPath Expressions

  • $: Select the root document.
  • $.user.name: Select a nested property with dot notation.
  • $["user-name"]: Select a property whose name requires bracket notation.
  • $.items[0]: Select the first item in an array.
  • $.items[*].id: Select the id property from every item.
  • $..price: Search for price properties recursively.
  • $.items[?(@.price > 10)]: Filter items when predicate syntax is supported.

Dot Notation and Bracket Notation

Dot notation is concise for ordinary property names:

$.store.book[0].title

Bracket notation is useful for property names containing spaces, hyphens, punctuation, or characters that are not convenient in an identifier:

$["user profile"]["display-name"]

Use the notation supported by the evaluator and quote property names exactly as they appear in the JSON.

Wildcards, Recursive Descent, and Slices

A wildcard selects multiple children, while recursive descent searches below the current location. Array slices select a range when supported:

  • *: Match children or array items.
  • ..: Search descendants recursively.
  • [0:3]: Select a slice when the evaluator supports slice syntax.

Recursive queries can return many nodes, especially in large documents. Review match paths rather than assuming that every value with the same key belongs to the same logical object.

Filter Expressions

Filters let you select array items based on a condition, such as:

$.store.book[?(@.price < 10)].title

Filter syntax and available functions vary between JSONPath implementations. Comparisons involving missing properties, null values, strings, and numbers should be tested against the actual evaluator.

Match Values Are Not Enough

Two nodes can return the same value but represent different locations:

{"users":[{"id":1},{"id":1}]}

A useful result view should show both the value and its path, such as $.users[0].id and $.users[1].id. An RFC 6901 JSON Pointer can provide another precise location format for integration with tools that use JSON Patch or pointer-based updates.

Invalid Expression vs No Match

These results are different:

  • Invalid expression: The parser cannot understand the query or the evaluator does not support part of its syntax.
  • No match: The expression is valid but does not select a node in the current document.
  • Successful match: One or more values or nodes were selected.

Keeping these states separate makes debugging much faster. A syntax error should be fixed in the expression, while a no-match result usually requires checking property names, array indexes, document structure, or filter conditions.

JSONPath and JSON Pointer

JSONPath is a query language that can select multiple nodes. JSON Pointer, defined by RFC 6901, identifies one location using slash-separated tokens such as /users/0/name. They solve different problems and should not be presented as interchangeable syntax.

JSONPath in API Testing

JSONPath is useful for checking API responses, extracting fields, and writing assertions. For example, a test can verify that $.data.items[*].id returns expected identifiers. The exact expression syntax must match the API testing tool or library used by the project.

Implementation and Compatibility

Before copying a query into production code, test it in the target library. A query that works in a browser tester may fail in a tool that uses a different JSONPath dialect, function set, filter syntax, or result model. If the page implements RFC 9535, include the specification version and supported extensions in the reference.

Large JSON Documents

Direct property access is usually cheaper than recursive searches and complex filters. For large documents, result rendering can become as important as evaluation. A Web Worker, lazy filtering, virtualized results, and a result limit can keep the interface responsive.

Browser-Based Privacy

This tester is designed to parse and evaluate JSON in the browser instead of sending the document to a remote service. That is useful for development payloads and private configuration samples, but it is not a secret-management system. Avoid entering credentials, tokens, private customer information, or production secrets into any online tool.

Related Articles

Related Tools

Frequently Asked Questions

What is JSONPath?

JSONPath is a query syntax for selecting values or nodes from a JSON document. It provides selectors for the root, object properties, arrays, wildcards, recursive searches, slices, and filters, depending on the dialect and evaluator.

Which JSONPath specification does this tool support?

This page uses its own evaluator for a documented subset of JSONPath: `$`, `.name`, `['name']`, `[index]`, `*`, `..name`, and simple filters such as `[?(@.price < 10)]`. It does not implement the full RFC 9535 standard: array slices, unions, regular expressions, and functions are not supported. Expressions outside the subset are reported as invalid instead of returning partial results.

What is the difference between a syntax error and no matches?

A syntax error means the expression cannot be parsed or uses unsupported syntax. No matches means the expression is valid under the evaluator but does not select any node in the supplied JSON. These cases require different fixes.

What are common JSONPath expressions?

Examples include $.user.name for a nested property, $.items[0] for the first array item, $.items[*].id for every item ID, $..price for recursive price searches, and $.items[?(@.price > 10)] for a filter when filter syntax is supported.

What does $ mean in JSONPath?

The dollar sign usually represents the root of the JSON document. For example, $.users starts at the root and selects the users property.

What does .. mean in JSONPath?

Recursive descent searches descendants below the current location. For example, $..id can match id properties at multiple nesting levels, depending on the evaluator's semantics.

Does the tool support filters?

Yes, with a limited set of comparison operators: `==`, `!=`, `<`, `>`, `<=`, and `>=`, for example `$.store.books[?(@.price < 10)]`. Regular expression filters and function calls are not supported and are reported as invalid expressions.

Does the tool support array slices?

No. Slice expressions such as `$.items[0:3]` are not supported by this evaluator, and neither are unions such as `$.items[0,2]`. Use a wildcard with a filter, or select the indexes you need one at a time.

Why do I get duplicate-looking results?

Different nodes can contain the same value. Inspect the concrete match path, JSON Pointer, or source location to distinguish them instead of relying only on the displayed value.

Can I see where each result came from?

If path reporting is enabled, each match can include its concrete JSONPath location and possibly an RFC 6901 JSON Pointer. This is useful when identical values appear in several parts of a document.

Can I use JSONPath to modify JSON?

This page is designed for querying and extracting values. JSONPath itself is primarily a selection syntax; modifying the selected data requires a separate transformation or update operation.

Can I use it with API responses?

Yes. Paste a valid API response and use JSONPath to inspect fields, arrays, nested objects, and filter results. The evaluator only queries the data supplied to the page and does not know the API's business semantics.

Can I test large JSON documents?

The practical limit depends on document size, nesting depth, array length, evaluator complexity, result count, and browser memory. Filters and recursive searches may require more work than direct property access.

Is my JSON uploaded to a server?

This page is designed to parse and query JSON in your browser without requiring a server upload. You should still avoid entering passwords, API keys, access tokens, private customer data, or confidential production payloads into any browser-based tool.

Is this a free JSONPath tester?

Yes. You can paste JSON, test supported JSONPath expressions, inspect matches and paths, and copy the results without creating an account.