XPath Tester

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.

XML input

Well-formed XML documents and fragments with one root element are supported.

Processed locally in your browser Limit 5 MB. Your input is processed in your browser and is not uploaded or sent to a server. Avoid pasting production secrets, access tokens, private keys, passwords, or sensitive customer data unless you understand the risk.

Use element paths, //, predicates, @attributes, text(), contains(), and namespace prefixes declared in the XML.

XPath results

Matched nodes, attributes, text values, paths, warnings, and JSON report output.

Ready to test XPath

Paste XML, enter an XPath expression, or load a sample. Valid small inputs are tested automatically after a short pause.

XPath options

XPath evaluation uses the browser XPath engine. Declared prefixes can be resolved automatically, but default namespaces still need prefixed XPath names or local-name() expressions.

XPath Testing Guide

Query XML nodes, attributes, and text without uploading the document

Use XPath Tester to debug XML queries for API responses, sitemap files, SOAP payloads, test fixtures, configuration exports, and document automation.

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.

XPath syntax basics

Use absolute paths like /catalog/book, anywhere selectors like //book, attributes like @id, and text selections like text().

Attributes and text nodes

Attribute matches return attribute names and values. Text node matches return the text content and a generated XML path to the parent node.

Predicates and contains()

Filter elements with predicates such as //book[@available="true"] or text checks such as //title[contains(., "API")].

Namespaces

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 Tester vs JSONPath Tester

XPath is for XML nodes and attributes. JSONPath is for JSON objects and arrays. Use the JSONPath Tester when the source document is JSON.

Common mistakes

Watch for invalid XML, unescaped ampersands, default namespaces, case-sensitive element names, missing attribute markers, and predicates with mismatched quotes.

Safety model

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.

Browser support limits

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.

XPath Tester FAQ

Does this XPath Tester upload my XML?

No. XML parsing and XPath evaluation happen locally in your browser.

Can XPath select attributes?

Yes. Use //element/@name or //@id to select attribute nodes.

Can XPath select text values?

Yes. Use text() for direct text nodes or string(...) when you want a scalar string result.

Why does a namespaced XPath return no matches?

Default namespaces do not match unprefixed element names in browser XPath. Use a declared prefix or a local-name() expression.

Does this support XPath 2.0?

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.

What is the difference between XPath Tester and XML Formatter?

XML Formatter validates and beautifies the whole document. XPath Tester queries the document and shows only matched nodes or scalar results.

What is the difference between XPath Tester and JSONPath Tester?

XPath queries XML. JSONPath queries JSON. They solve similar inspection tasks for different document formats.

Can I copy matched values?

Yes. Copy matched values, the JSON report, summaries, warnings, and error messages.