# How to Use JSON Path Tester: A Complete Tutorial

When working with complex JSON documents, navigating to specific values manually is tedious and error-prone. JSON Path Tester lets you query JSON data using path expressions, extracting exactly the data you need.

## What is JSON Path Tester?

JSON Path Tester is an interactive tool for testing JSONPath queries against your JSON data. JSONPath is a query language for JSON that lets you specify paths through a document — similar to how XPath works for XML. You write a path expression, and the tool shows you which values match.

## Step-by-Step Guide

### Step 1: Access the Tool

Open [xingdian.net's JSON Path Tester](https://www.xingdian.net/en-US/xdt/tools/dev/code/json-path-tester) in your browser. You'll see panels for JSON input, path expression, and query results.

### Step 2: Paste Your JSON

Enter a JSON document:

```json
{
    "store": {
        "books": [
            {"title": "Book A", "price": 29.99},
            {"title": "Book B", "price": 39.99},
            {"title": "Book C", "price": 19.99}
        ],
        "location": "Shanghai"
    }
}
```

### Step 3: Write a JSONPath Expression

Enter a path expression. For example:

*   `$.store.books[*].title` — Get all book titles
    
*   `$.store.books[0]` — Get the first book
    
*   `$.store.books[?(@.price<30)].title` — Get titles of books under $30
    

### Step 4: Run the Query

Click "Test" or "Run". The tool shows matching results:

For `$.store.books[*].title`:

```json
["Book A", "Book B", "Book C"]
```

### Step 5: Iterate and Refine

Adjust your path expression based on results. The interactive feedback lets you refine until you extract exactly the data you need.

## Common Operations

*   **Test single paths**: Verify a path matches expected data
    
*   **Filter with conditions**: `[?(@.price>20)]` for conditional matching
    
*   **Descendant search**: `$..title` to find "title" at any level
    
*   **Wildcard paths**: `$.*` to get all top-level values
    
*   **Array slicing**: `$[0:2]` to get array elements 0 and 1
    

## Summary

JSON Path Tester is indispensable for working with complex JSON documents. It turns tedious manual navigation into precise, repeatable queries.

Check out [xingdian.net's JSON Path Tester](https://www.xingdian.net/en-US/xdt/tools/dev/code/json-path-tester) for free online processing.
