Calculates on this device. File exports run online.
JSON Query Tester
Paste JSON and try a query on it: JSONPath as standardised in RFC 9535, JMESPath, or a JSON Pointer. You see every result with its path. You can also list the path of every value in four notations, apply or make a JSON Patch or merge patch, and write SQL Server queries that make JSON from a table (FOR JSON PATH) or a table from JSON (OPENJSON). Everything runs in your browser.
Enter your values
Check these values
This is off unless you turn it on. Saved entries stay in this browser only. Untick the box to delete them.
Your values are worked out in this browser. They are not sent to a server.
Your result will show here
Fill in the values, then choose the button below them.
Your result
How it was worked out
How to use it
- Choose Run a query, paste your JSON (or open a .json file), choose the language and type the query, then press Run the query.
- To find the path of a value you see, choose List every path: copy it in the notation you need.
- For changes, choose JSON Patch and merge patch. For SQL Server, choose SQL Server JSON.
Query languages
- JSONPath (RFC 9535): $ is the document; .name or ['name'], [0], [-1], [1:3], * and .. (all levels); filters such as [?@.price < 10], with &&, ||, !, and the functions length(), count(), match(), search() and value().
- JMESPath: store.book[0].title, projections such as store.book[*].title, filters such as store.book[?price <
10], pipes |, multi-select lists and hashes, and functions such as sort_by(), max_by(), join() and length(). - JSON Pointer (RFC 6901): /store/book/0/title, with ~1 for / and ~0 for ~ inside a name.
SQL Server
- FOR JSON PATH: each row becomes an object, and a column alias with dots, such as [address.city], becomes a nested object. Columns that are NULL are left out unless INCLUDE_NULL_VALUES is set. The columns of one nested object must stand next to each other, or SQL Server stops with error 13601.
- OPENJSON … WITH reads a JSON list as a table; JSON_VALUE and JSON_QUERY read one value with a path such as $.store.bicycle.color.
Large files
The box below runs your JSONPath or JMESPath query on a JSON file of up to 1 GB on the server. Its JSONPath reader follows the classic style: names, wildcards, indexes, slices and .. work as above, but filters are written as [?(@.price < 10)] and functions are not the same.