🔍 JSONPath Evaluator - JSON Query Tester

Professional JSONPath testing tool for developers to query JSON data using JSONPath expressions. Features real-time evaluation, multiple result formats (values/paths/both), syntax validation, and comprehensive JSONPath reference guide for API testing, data extraction, and JSON processing.

Paste your JSON data here. Must be valid JSON format.
Enter JSONPath expression starting with $ (root). Example: $.users[*].name
Choose how to display the query results
Format JSON output with proper indentation and syntax highlighting
Display a quick reference guide for JSONPath syntax and examples

JSONPath Results:

🔍 JSONPATH QUERY

$.users[*].name → 3 matches found

Query executed successfully

📝 Query Details

JSONPath: $.users[*].name
Result Format: Values Only
Matches Found: 3 results

Query Results

// JSONPath: $.users[*].name
[
"John Smith",
"Jane Doe",
"Bob Johnson"
]
📊 3 matches • Values format • 45ms execution time

📚 JSONPath Quick Reference

$ - Root element
.property - Child property
['property'] - Bracket notation
[0] - Array index
[*] - All array elements
.. - Recursive search
[?(@.age > 21)] - Filter expression

⚡ Processing Summary

45ms
Execution Time
2.1KB
JSON Size
3
Matches

How to Use This JSONPath Evaluator - JSON Query Tester

The JSONPath Evaluator is a powerful tool for testing and debugging JSONPath queries on JSON data. Simply paste your JSON data, enter a JSONPath expression, and instantly see the matched results.

How to Use:

  1. Paste JSON Data: Copy your JSON into the input area - it will be validated automatically
  2. Enter JSONPath Query: Write your JSONPath expression starting with $ (root)
  3. Choose Result Format: Select values only, paths only, or both
  4. Execute Query: Click "Evaluate JSONPath" to see results instantly
  5. Copy or Download: Use the buttons to copy results or download as JSON

JSONPath Syntax Examples:

  • $.users[*].name - Get all user names
  • $.products[0].price - Get first product price
  • $..category - Find all category fields recursively
  • $.items[?(@.price > 100)] - Filter items over $100
  • $.data[0:3] - Get first 3 array elements

How It Works

The JSONPath Evaluator uses a JavaScript-based JSONPath engine to parse and execute queries against your JSON data in real-time.

Processing Steps:

  1. JSON Validation: Input JSON is parsed and validated for syntax errors
  2. Query Parsing: JSONPath expression is analyzed for syntax and structure
  3. Path Evaluation: The query is executed against the JSON data structure
  4. Result Collection: Matched nodes are collected with their values and paths
  5. Format Output: Results are formatted according to your preferences

Supported JSONPath Features:

  • Root Selector: $ represents the root element
  • Property Access: .property or ['property']
  • Array Operations: [0], [-1], [start:end], [*]
  • Recursive Descent: .. searches all descendant nodes
  • Filter Expressions: [?(@.property operator value)]
  • Multiple Selectors: [0,2,5] selects multiple indices

When You Might Need This

Frequently Asked Questions

What is JSONPath and how does it work?

JSONPath is a query language for JSON, similar to XPath for XML. It uses a string syntax to select and extract values from JSON documents. JSONPath expressions start with '$' (root) and use dots, brackets, and special operators to navigate JSON structures. For example, '$.users[*].name' selects all name fields from a users array.

How do I query arrays and nested objects effectively?

Use [*] for all array elements, [0] for specific indices, [start:end] for slicing, and dot notation for nested objects. Examples: '$.products[*].price' gets all prices, '$.data.users[0].profile.email' navigates nested structures, and '$..category' recursively finds all category fields anywhere in the JSON.

What's the difference between values, paths, and both result formats?

Values format shows only the matched data (e.g., ['John', 'Jane']). Paths format shows the JSONPath locations (e.g., ['$.users[0].name', '$.users[1].name']). Both format displays matched values alongside their corresponding paths, which is helpful for understanding exactly where data was found in the JSON structure.

How do I use filter expressions to find specific items?

Filter expressions use [?(@.property operator value)] syntax. The @ symbol represents the current item being evaluated. Examples: '$.products[?(@.price > 50)]' finds expensive products, '$.users[?(@.age >= 18)]' filters adult users, and '$.items[?(@.category == "electronics")]' matches specific categories. Operators include ==, !=, <, >, <=, >=.

Can I test multiple JSONPath queries on the same JSON data?

Currently, the tool evaluates one JSONPath query at a time for focused testing and clear results. To test multiple queries, simply change the JSONPath expression field and click "Evaluate JSONPath" again. This approach helps you understand each query's behavior individually and compare results effectively. For complex data extraction, consider using recursive descent (..) or multiple array selectors.