# JSONPath tester

Canonical page: https://datalens.flazetech.in/jsonpath

Publisher: DataLens by Flazetech (https://datalens.flazetech.in/about).

Test JSONPath expressions online to extract nested fields, query arrays, and inspect matching JSON values. Run your query against a sample or your own document.

## How to query JSON with JSONPath

1. Paste a valid JSON document.
2. Enter an expression such as $.users[*].name or $..id.
3. Select Run to see an array of matching values, or a validation error.

## Worked example

### Example input

```text
{"users":[{"name":"Alex"},{"name":"Sam"}]}

Query: $.users[*].name
```

### Example output

```text
["Alex","Sam"]
```

## Common questions

### What does $ mean in JSONPath?

The $ symbol selects the root document. A dot selects a named property, [0] selects an array index, [*] selects all array items, and .. searches descendants.

### Why does JSONPath return an empty array?

An empty array means no values matched the expression. Check property spelling, array indices, and the shape of your input. Invalid JSON or an invalid expression is reported separately.

### How do I extract every matching nested field?

Use recursive descent: $..id finds properties named id at any depth. To target a specific array, use a path such as $.users[*].id. The output is an array of matching values.

### Does JSONPath change my input?

No. The tester reads the JSON document and returns selected values. It does not update or delete properties. Different JSONPath implementations can support different syntax; DataLens uses JSONPath Plus with safe evaluation.

## Related guides

- [How to format JSON and fix invalid JSON](https://datalens.flazetech.in/guides/format-validate-json)
- [Compare JSON objects without key-order noise](https://datalens.flazetech.in/guides/compare-json-objects)

## Data handling

[Processing and privacy](https://datalens.flazetech.in/privacy). Formatting and conversion run in the browser. Optional sharing and API requests can transmit supplied data. The interactive tools require JavaScript; this reference does not.
