Web Tools
XPath Tester
Test XPath expressions against XML documents with instant results. Supports element, attribute, text, and comment node selection, predicates, position functions, and aggregate functions. Built-in XPath 1.0 interpreter — no native browser XPath dependency. Runs entirely in your browser — your data never leaves your machine.
xpath xml query selector parser tester
Published May 30, 2026
All interactive tools run entirely in your browser. Your data never leaves your device.
How It Works
Paste an XML document and enter an XPath expression to see matching nodes instantly. The tool parses XML with DOMParser and evaluates expressions with a built-in XPath 1.0 subset interpreter — fully client-side with no dependencies.
Supported XPath Syntax
- Absolute paths:
/root/child/grandchild - Descendant shorthand:
//element(search anywhere in the document) - Wildcards:
*matches any element name - Attributes:
@attrfor attribute axis,@*for all attributes - Node tests:
text(),comment(),processing-instruction(),node() - Predicates:
[1],[last()],[position()=n],[@attr="value"] - String functions:
contains(),starts-with() - Aggregate functions:
count(),string(),normalize-space(),boolean(),sum()
Features
- Instant evaluation: results update as you type
- Node details: type, name, value, reconstructed path, attributes, children count
- Multiple result types: node-set, string, number, boolean
- Execution timing: see how fast the query runs
- Copy results: copy all matched nodes to clipboard
- 5 examples: bookstore catalog, employees, recipes, configuration, RSS feed
- Private: runs entirely in the browser — no data transmitted
Use Cases
- Testing XPath queries before using them in code (XSLT, web scraping)
- Debugging XML document structure and data extraction
- Learning XPath syntax with instant feedback
- Validating XML data against expected structure
- Extracting specific data from XML APIs or configuration files