Quick summary
Use practical JSONPath examples to query root properties, nested objects, arrays, wildcards, recursive fields and filters in JSON data. This guide gives you a clear, practical explanation before you use the related online tool.
JSONPath mental model
JSONPath is a query notation for selecting values from JSON. Most expressions start at the root with $, then navigate properties and arrays. Exact syntax support can vary between implementations, especially for filters and advanced operators, so test expressions in the environment where they will run.
Root and nested properties
Use $.name for a property on the root object. For nested data such as {"customer":{"email":"a@example.com"}}, $.customer.email selects the email. Bracket notation can be useful for property names that contain spaces or characters that do not fit simple dot notation.
Array indexes and slices
For a users array, $.users[0] selects the first element and $.users[*] selects every element. $.users[*].email projects the email property from each user. Some implementations also support slices such as [0:2], but portability should be verified.
Wildcards and recursive descent
The wildcard * selects all matching children at a level. Recursive descent, commonly written $..id, searches through nested structures for fields named id. Recursive queries are convenient for exploration but can return more matches than expected in large or heterogeneous payloads.
Filter examples
Many JSONPath implementations support filters such as $.products[?(@.price < 100)] to select products below a price threshold. String comparisons, logical operators and exact filter grammar vary across libraries, so avoid assuming an expression tested in one engine is portable to every platform.
API-response example
For an API response containing orders, $.orders[*].orderId can extract all order IDs. To inspect the first order’s line items, use a path such as $.orders[0].items[*].sku. Build the path incrementally when working with unfamiliar payloads.
Debugging a JSONPath that returns nothing
First validate and format the JSON. Then confirm whether the root is an object or array, check property spelling and case, and test one segment at a time. If a filter fails, verify that the implementation supports that filter syntax and that compared values have the expected types.
Practical workflow
Paste representative JSON into JSONPath Explorer, start with $, expand to the target branch, then add array selection or filters. Confirm both the number of matches and their values before moving an expression into an automated test, ETL step or production script.
Continue with a free tool
Related FormatForge tools
JSONPath Explorer
Test JSONPath expressions against JSON data and inspect the matching values.
Open tool →JSON Studio
Format, validate, view, compare, split, merge and analyze JSON in one professional workspace.
Open tool →JSON Schema Generator
Generate a JSON Schema from sample JSON for API validation and documentation.
Open tool →JSON to Excel
Convert nested JSON into Excel with flattened columns or parent-child sheets for ERP, ePOS and business validation.
Open tool →Explore the complete workflow
Continue from this guide to the broader category or curated collection to find related tools and supporting workflows.
Frequently asked questions
What does $ mean in JSONPath?
It normally represents the root of the JSON document.
How do I select every item in an array?
A common expression is $.items[*], where * selects all array elements.
What does $..id do?
In implementations supporting recursive descent, it searches nested content for fields named id.
Why does a JSONPath filter work in one tool but not another?
Advanced JSONPath syntax is not perfectly uniform across implementations, so filter and operator support can differ.
How should I debug JSONPath?
Validate the JSON, confirm object and array structure, then build the expression one segment at a time and inspect the matches.
Keep learning
Related guides
Developer
JWT Explained for Developers: Structure, Claims, Signatures and Validation
Understand JSON Web Tokens, header-payload-signature structure, claims, signature verification, expiration and common JWT security mistakes.
Developer
Base64 Encoding Explained: Text, Images, Data URLs and Decoding
Understand what Base64 encoding does, why encoded data grows in size, how images and Data URLs use Base64, and when to encode or decode it.
Developer
Cron Expression Guide with Examples: Minutes, Hours, Days and Scheduling
Learn cron expression fields with practical examples for hourly, daily, weekly and monthly schedules, plus common portability and timezone mistakes.
Developer
Regex Tester Guide for Beginners
Learn how regex patterns work and how to test them safely.