JSON Path Finder

Skip to editor
Explorer
Open Files

No files open

0 files open

jsoneditor.io v2

No file open

Create a new file or open an existing one from the sidebar

JSONUTF-8
Spaces: 2

How do I get the path to a value in JSON?

To get the path to a value in JSON, find it in the tree and right-click it. Copy path gives you a JSONPath expression like $.items[1].price, and Copy path as gives you the same location in JavaScript, jq or JSON Pointer form.

Keys with spaces, dots or dashes switch to bracket notation automatically, so the path you copy actually works when you paste it into code. Press Ctrl+V or Cmd+V on the tree to load your own JSON.

  1. Press Ctrl+V or Cmd+V on the tree to open your JSON.
  2. Right-click the value you want.
  3. Choose Copy path, or pick a format under Copy path as.

Example

Right-click "city" inside "shipping address"
{
  "customer": {
    "shipping address": {
      "city": "London",
      "postcode": "NW1 6XE"
    }
  }
}
Copy path as
JSONPath      $.customer['shipping address'].city
JavaScript    data.customer["shipping address"].city
jq            .customer["shipping address"].city
JSON Pointer  /customer/shipping address/city

Questions people ask

What's the difference between JSONPath, jq and JSON Pointer paths?

They all point at the same place, they just come from different tools. JSONPath ($.a.b[0]) is used by API testing tools and plenty of libraries, jq paths (.a.b[0]) work in the jq command line tool, and JSON Pointer (/a/b/0) is the RFC 6901 format that JSON Patch and JSON Schema use.

How are keys with spaces or special characters handled?

They get quoted. A key like first name becomes $['first name'] in JSONPath and data["first name"] in JavaScript, and JSON Pointer escapes ~ and / as ~0 and ~1.

Can I copy the key or the value too?

Yes, the same menu has Copy key (or Copy index for array items) and Copy value.

How do I test a JSONPath expression?

Switch to Query view and type it in, the matches update as you type. The JSONPath tester page has the details.

Is my data uploaded anywhere?

No, this runs entirely in your browser, so nothing you paste is sent to a server. The only feature that sends data anywhere is the optional AI assistant, and only when you actually ask it something.