JSONPath examples

JSONPath examples

JSONPath is a way to describe “where” a value lives inside JSON. Different tools have slightly different JSONPath dialects; these examples use common patterns.

Sample JSON

{
  "user": {
    "id": 42,
    "name": "Asha",
    "emails": ["[email protected]", "[email protected]"],
    "address": { "city": "Austin", "zip": "78701" }
  },
  "orders": [
    { "id": "o1", "total": 10.5 },
    { "id": "o2", "total": 25.0 }
  ]
}

Common paths

How to use JSONPath on FormatJSON

Paste JSON into “JSON One” and click Json Path. The tool generates a path-like mapping for keys and nested structures to help you locate values quickly.

Related: Validate JSON · Compare JSON