What is an XPath Tester?
An XPath Tester runs an XPath expression against XML and shows the matching nodes, attribute values, text nodes, paths, and a JSON report.
Paste XML and an XPath expression to find matching nodes, attributes, and text values directly in your browser.
Paste XML and enter an XPath expression to begin.
Well-formed XML documents and fragments with one root element are supported.
Use element paths, //, predicates, @attributes, text(), contains(), and namespace prefixes declared in the XML.
Matched nodes, attributes, text values, paths, warnings, and JSON report output.
Paste XML, enter an XPath expression, or load a sample. Valid small inputs are tested automatically after a short pause.
XPath Testing Guide
Use XPath Tester to debug XML queries for API responses, sitemap files, SOAP payloads, test fixtures, configuration exports, and document automation.
An XPath Tester runs an XPath expression against XML and shows the matching nodes, attribute values, text nodes, paths, and a JSON report.
Use absolute paths like /catalog/book, anywhere selectors like //book, attributes like @id, and text selections like text().
Attribute matches return attribute names and values. Text node matches return the text content and a generated XML path to the parent node.
Filter elements with predicates such as //book[@available="true"] or text checks such as //title[contains(., "API")].
Browser XPath resolves prefixed names through a resolver. This tool can map declared prefixes, while default namespaces usually require explicit prefixes or local-name().
XPath is for XML nodes and attributes. JSONPath is for JSON objects and arrays. Use the JSONPath Tester when the source document is JSON.
Watch for invalid XML, unescaped ampersands, default namespaces, case-sensitive element names, missing attribute markers, and predicates with mismatched quotes.
XML is treated as untrusted text. The tool uses browser parsing and XPath evaluation, does not use JavaScript eval, and does not fetch schemas, DTDs, or remote resources.
XPath behavior comes from the current browser. XPath 1.0 features are broadly supported; newer XPath 2.0 and 3.0 functions may not be available.
No. XML parsing and XPath evaluation happen locally in your browser.
Yes. Use //element/@name or //@id to select attribute nodes.
Yes. Use text() for direct text nodes or string(...) when you want a scalar string result.
Default namespaces do not match unprefixed element names in browser XPath. Use a declared prefix or a local-name() expression.
The tool uses the browser-native XPath engine, which is generally XPath 1.0 oriented. Some XPath 2.0 and 3.0 functions are not available.
XML Formatter validates and beautifies the whole document. XPath Tester queries the document and shows only matched nodes or scalar results.
XPath queries XML. JSONPath queries JSON. They solve similar inspection tasks for different document formats.
Yes. Copy matched values, the JSON report, summaries, warnings, and error messages.