Sniplint Logo
Loading...

XPath & JSONPath Generator — Extract Every Path from XML or JSON

SnipLint Path Generator is a free online tool that extracts every XPath or JSONPath expression from your XML or JSON document — instantly, with no configuration. Paste your data, click Extract Paths, and get a full annotated list of all element paths, attribute paths, array references, and leaf values. Filter results using substring, prefix, or regex matching.

What It Does

  • Auto-detects format — no manual format selection for JSON or XML
  • Extracts all paths — elements, attributes, arrays, objects, and leaf values
  • Type-colored badges — Element (teal), Attribute (rose), Array (amber), Object (purple), Value (blue)
  • Value previews — see truncated leaf values inline with tooltip on hover
  • Copy single or all paths — one-click copy per row or bulk copy
  • Query / Filter tab — filter by Contains, Starts With, or full Regex
  • Share via ID or QR — send the path list across devices

Common Use Cases

  • Explore deeply nested JSON API responses from REST or GraphQL APIs
  • Audit XML config files by listing every element and attribute path
  • Build XPath queries for XSLT transformations or Selenium tests
  • Build JSONPath expressions for Postman, Karate, or JMeter assertions
  • Debug complex data structures by searching for specific field names
  • Document an API response structure by extracting and sharing the path list

Frequently Asked Questions

What is an XPath and why do I need it?
XPath (XML Path Language) is a standard syntax for addressing parts of an XML document. It is widely used in XSLT transformations, XML parsers, Selenium web testing, and API integrations. XPath expressions like /catalog/book/@id let you pinpoint specific nodes without parsing the whole document manually.
What is a JSONPath?
JSONPath is the JSON equivalent of XPath. A JSONPath expression like $.users[0].email selects the email field of the first user in a JSON document. It is commonly used in API testing tools like Postman and Karate.
How does auto-detection work?
The tool checks whether your input starts with { or [ (JSON) or < (XML) and applies the appropriate path extraction algorithm. A colored badge below the editor shows what was detected.
What types of paths are extracted from XML?
The extractor produces element paths like /catalog/book/title and attribute paths like /catalog/book/@id. Each path is labeled with a type badge (Element or Attribute) for clarity.
What types of paths are extracted from JSON?
The extractor produces full JSONPath expressions for every node — including nested objects ($.user), array elements ($.users[0]), and leaf values ($.users[0].email). Each path shows its type (Object, Array, or Value).
Can I share the extracted path list?
Yes. Click "Send to Server" after extracting paths to get a 4-digit ID and QR code. Recipients can retrieve the full path list at sniplint.in/clipboard using the ID or by scanning the QR code.

Related Tools