> codebench_TOOL: HomeLOCAL-ONLY⌘K Switch

JSON Path Tester

Tool guide

Test JSONPath expressions against JSON data

Input: This tool processes input in your browser. Check in Network (opens in a new tab)

$
Result:

One dotted key or two nested keys?

JSON Data
Results
Matched results will appear here

Query a JSON document and inspect either the matched values or their paths. The print proof example runs two selectors against one record. Both match; only one returns the recorded ink reading. Your own query and document are kept separate.

How to use it

  1. Choose Run example to compare two queries on the same print proof without changing your JSON Data editor.
  2. To repeat the check manually, paste the sample into JSON Data and the expression into the field next to $. Choose Values and wait for Results to refresh.
  3. Change only the expression to $.prints[0].ink.black. The nested target is [0.46]; choose Paths to see where it came from.

Worked example

JSON Data
{"prints":[{"id":"N-3","ink.black":0.72,"ink":{"black":0.46}}]}
JSONPath expression
$.prints[0]['ink.black']
Example output
[
  0.72
]

The array contains one match, not one whole print record. Here the brackets in the expression select a literal key containing a dot; the dot-separated expression instead descends through two keys.

What to watch for

A nonempty result does not prove you found the intended field. Do not align wildcard results with a separate list of IDs by position; a missing member contributes no match.

Frequently asked question

Can I distinguish a missing field from an explicit null?
Yes. With Values selected, no match produces an empty result array; a field whose value is null contributes a null element. A field with the number zero also contributes a match.

Browse JSON tools

Further reading

> codebench $Ctrl+Enter Run