Oh MyUtils

JSONPath Tester - Evaluate JSONPath Expressions Online

Test and evaluate JSONPath expressions against JSON data in real-time. Supports filters, recursive descent, array slicing, and more — 100% client-side, no data sent to server.

Frequently Asked Questions

What is JSONPath?

JSONPath is a query language for JSON data, similar to XPath for XML. It was standardized as RFC 9535 in February 2024 by the IETF. JSONPath allows you to select and extract specific values from a JSON document using path expressions like $.store.book[0].title.

How do I use the JSONPath Tester?

Paste your JSON data into the JSON input area (or click Sample to load example data), then type a JSONPath expression in the expression field. Results appear automatically in real-time as you type. You can copy the results or try different expressions from the examples panel.

Is my data secure?

Yes. All processing happens 100% in your browser. Your JSON data and JSONPath expressions are never sent to any server. This makes it safe to use with production API responses, configuration files containing secrets, or any sensitive data.

What JSONPath syntax is supported?

The tool supports the standard JSONPath operators: root ($), child (. or []), recursive descent (..), wildcard (*), array index ([n]), array slice ([start:end:step]), and filter expressions ([?()]). It uses the JSONPath-Plus library which extends the RFC 9535 standard with additional features.

What is the maximum JSON size supported?

The tool supports JSON data up to 5MB in size. For optimal performance with real-time evaluation, JSON under 1MB is recommended. Larger datasets may experience slight delays during evaluation.

What is the difference between JSONPath and JMESPath?

JSONPath (RFC 9535) and JMESPath are both JSON query languages but with different syntax and capabilities. JSONPath uses $ as root and . for traversal (e.g., $.store.book[*].author), while JMESPath uses different syntax (e.g., store.book[*].author). JSONPath is more widely known; JMESPath is used extensively in AWS CLI.

Code Examples

// Using jsonpath-plus in Node.js
const { JSONPath } = require('jsonpath-plus');

const data = {
  store: {
    book: [
      { category: "fiction", author: "Tolkien", title: "The Lord of the Rings", price: 22.99 },
      { category: "reference", author: "Nigel Rees", title: "Sayings of the Century", price: 8.95 }
    ]
  }
};

// Basic query
const authors = JSONPath({ path: '$.store.book[*].author', json: data });
console.log(authors); // ["Tolkien", "Nigel Rees"]

// Filter expression
const cheapBooks = JSONPath({ path: '$.store.book[?(@.price < 10)]', json: data });
console.log(cheapBooks); // [{ category: "reference", ... }]

// Recursive descent
const allPrices = JSONPath({ path: '$..price', json: data });
console.log(allPrices); // [22.99, 8.95]

Related Tools