Calculator
What the XPath Tester does
XPath Tester: checks Status, Matches and Matches from XML or HTML, XPath expression and Parse as. Example: xpath expression //book[price > 7]/title/text() and parse as XML gives status Needs a browser.
Feed it XML or HTML, XPath expression and Parse as; it hands back Status, Matches and Matches. Change any input and the output follows immediately.
Reading raw machine output is painful; a formatted view makes the structure obvious. That is usually what brings anyone cleaning up machine output here.
The parsing happens in your browser, so sensitive payloads never leave your machine.
Below the tool you will find the field reference, the method, and an example computed from the values it opens with.
What do the XPath Tester fields mean?
The XPath Tester uses 3 inputs. Because the form arrives filled, the first useful result costs you zero typing.
| Field | What to enter | Default |
|---|---|---|
| XML or HTML | paste or type any amount of text | <catalog> <book id="1" lang="en"> <title>Dune</title> <price>9.99</price> </book> <book id="2" lang="fr"> <title>Le Petit Prince</title> <price>6.50</price> </book> </catalog> |
| XPath expression | required | //book[price > 7]/title/text() |
| Parse as | choose from XML or HTML | XML |
How does the XPath Tester work?
Each output is derived from the inputs above in a single pass; there is no hidden state carried between runs, so the same inputs always give the same check.
Inputs are validated before anything is computed, so a bad entry is reported rather than quietly producing a wrong answer.
Worked example
These are the values the XPath Tester loads by default, and the result it produces from them. Open the tool above and you will find precisely these figures already in place.
| XML or HTML | <catalog> <book id="1" lang="en"> <title>Dune</titl… |
|---|---|
| XPath expression | //book[price > 7]/title/text() |
| Parse as | XML |
| Status | Needs a browser |
|---|---|
| Matches | |
| Matches | 0 |
How to use it
- Paste your content into XML or HTML.
- Enter XPath expression.
- Pick a value for Parse as: the options are XML or HTML.
- No submit step is needed; the output updates while you edit.
- Look at Status, Matches and Matches in the output panel.
- Use Copy Link if you want the same setup again later, or Print for a paper copy.
What this tool does not do
- Processing happens in your browser, so very large inputs are bounded by available memory.
- Output follows the common convention for this format; a specific toolchain may have its own house style.
- Comparisons across tools can differ where each uses a slightly different definition.
Frequently asked questions
3 things: XML or HTML, XPath expression and Parse as. Each field is pre-filled with a sensible default, so the quickest approach is to replace the one number you actually care about.
With the values loaded when the page opens, status comes out as Needs a browser. Nudge one field at a time to see which one the answer is most sensitive to.
No. Disconnect from the internet and it still works; that is the simplest proof there is no server call.
Free for any use, personal or commercial.
It is exact within the stated method. Anything the method does not model is simply out of scope.