Skip to main content

JSONPath Tester

Evaluate JSONPath expressions against any JSON document and inspect every matching node alongside its full path in the data tree. Supports dot notation, bracket notation, recursive descent, wildcards, array slicing, union indices, and filter expressions with six comparison operators including existence checks on nested properties.

Runs entirely in your browser

This tool sends nothing over the network. Everything you enter is processed on your device and never reaches our servers.

Data
Testing
Loading the tool
Reference

Documentation

JSONPath is a query language for extracting data from JSON documents, analogous to XPath for XML. Writing a JSONPath expression against a JSON document returns every matching node along with its location in the document tree; a built-in sample store document, containing books and a bicycle, is available for quick experimentation without supplying data of one's own.

Every expression starts with $, which represents the root of the document. The match count updates as an expression is refined, and every matching node appears in the results alongside the value it holds.

$ is the root node of the document. .key or ['key'] accesses a child property by name; bracket notation is required when a key contains spaces or special characters. .. is recursive descent, searching all descendants for a matching key regardless of depth. [*] is a wildcard, matching every element in an array or every value in an object. [0], [2], and [-1] access array elements by index, with negative indices counting from the end of the array. [0:3] and [1:5:2] slice an array with start, end, and an optional step parameter, following Python slice semantics. [?(@.price < 10)] is a filter expression, selecting elements where a condition on a child property holds true; the six comparison operators are ==, !=, <, <=, >, and >=, and a string value inside a filter must be enclosed in single quotes.

Pretty-printing displays matched nodes with indentation for readability. Showing matched node paths displays the full JSONPath location of each matched node alongside its value. Auto-evaluation can be turned off when working with a very large document, so evaluation only runs on demand rather than after every keystroke.

Against the default sample data, $.store.book[*].author returns every author name, $..price returns every price value via recursive descent, $.store.book[?(@.price < 10)] returns books priced under 10, and $.store.book[0:2] returns the first two books using array slicing.

JSONPath expressions provide a concise way to locate and extract specific values from complex JSON structures. The following scenarios illustrate practical applications across multiple domains.

  • API Development: Validate API response payloads by writing JSONPath expressions that target expected fields, confirming that $.data.users[*].email returns the correct number of email addresses before writing integration tests.
  • Data Extraction: Pull specific values from deeply nested configuration files or database exports. Target nested arrays with expressions like $.config.servers[*].endpoints[?(@.protocol == 'https')] to extract only HTTPS endpoints from a multi-server configuration document.
  • Debugging: Inspect webhook payloads or event streams by querying for the fields that matter. Recursive descent with $..error surfaces every error object regardless of nesting depth, making it faster to locate failure points in complex response trees.
  • Documentation: Verify that JSON schema examples contain the fields described in technical documentation. Evaluate expressions against sample payloads to confirm that every documented path resolves to a value, catching mismatches between docs and actual data structures.
  • ETL Pipelines: Prototype extraction queries before embedding them in data pipeline code. Test expressions like $.records[*].metrics.revenue against sample data exports to confirm the correct values are selected, then copy the validated expression directly into pipeline configuration files.
  • Log Analysis: Parse structured JSON log entries by querying for specific severity levels or service names. Filtering with $.logs[?(@.level == 'error')] isolates error entries from a batch of log records, reducing manual scanning through large log files.
  • Front-End Development: Map API response fields to UI components by testing JSONPath expressions against mock data. Confirm that $.products[*].images[0] returns the primary image URL for each product before binding the data to a template.
Inputs, outputs, and what the JSONPath Tester computes

What the JSONPath Tester asks for and what it returns, as a plain list. Defaults, units, and ranges are the ones the form loads with.

Inputs

  • JSON Data
  • JSONPath Expression (text input) · default: $.store.book[*].author
  • Pretty-print results · default: on
  • Show matched node paths · default: off
  • Auto-evaluate on input · default: on
  • Results

Controls

Reset