Kalcify
Tools
BlogAboutContact
Kalcify

The World's Smartest Free Online Tools. 30+ free calculators & tools — no signup required.

💰 Finance

  • Loan EMI Calculator
  • Global Wealth Calculator
  • Investment Calculator
  • Salary Calculator
  • Sales Tax Calculator
  • Deposit Calculator
  • Compound Interest Calculator
  • Margin & Markup Calculator
  • ROI Calculator

📚 Education

  • Grade Calculator
  • Percentage Calculator
  • Countdown Timer
  • Online Graph Generator

Quick Links

  • Blog
  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service
  • Disclaimer

© 2026 Kalcify. All rights reserved.

Made with ❤️ for the Web 🌍

  1. Home
  2. Tools
  3. XPath Tester

XPath Tester

Evaluate XPath 1.0 expressions against XML or HTML live. Full axes, predicates, and functions using the native browser engine — type-aware results, 100% client-side.

100% Free No Signup Instant Results

XML Input

Parse error
DOMParser is not defined

Result

XPath Cheatsheet

/root/childAbsolute path from the root
//tagEvery <tag> anywhere in the document
@attrSelect an attribute
[@id="x"]Predicate — filter by attribute
[1] / [last()]Position predicate (1-based)
text()Text content of a node
.. / .Parent / current node
count() / string()XPath functions

Test XPath Expressions Online

XPath is one of the most powerful ways to pull data out of XML and HTML, and it is everywhere: web scraping, browser automation with Selenium and Playwright, XSLT transforms, and countless testing pipelines. But writing a correct XPath by hand — especially with predicates and axes — is fiddly. This tester turns it into a live playground: paste your document, type an expression, and watch the matched nodes update instantly as you type. Because it runs on your browser's native XPath engine, you get complete, standards-compliant XPath 1.0 behaviour with zero setup, and nothing you paste is ever uploaded. Instead of a silent empty result, a wrong expression produces a clear inline message so you can fix it fast.

XML & HTML Modes with Type-Aware Results

A standout feature is dual XML/HTML support. XML mode parses strictly, which is ideal for validating that a feed or API response is well-formed. HTML mode parses leniently the same way a browser does, which makes this tool genuinely useful for building and debugging the XPath selectors used in web scraping and end-to-end tests. The tester is also result-type aware. XPath does not only return nodes — count() returns a number, string() returns text, and functions like contains() return booleans. Rather than getting confused, the tool detects exactly what your expression produced and displays it correctly, showing serialized markup for node-sets or the raw value for scalars. You can copy or download any result for use elsewhere.

How to use this XPath Tester?

1

Choose Mode

Switch between XML (strict) and HTML (lenient) parsing to match your source.

2

Paste Markup

Drop your XML or HTML into the input panel — it is parsed live.

3

Write XPath

Type an expression like //book[@category="fiction"]/title, or pick an example.

4

Inspect Results

See matched nodes with their markup, or scalar values for functions like count().

Frequently Asked Questions

XPath (XML Path Language) is a query language for selecting nodes from an XML or HTML document. It uses path-like expressions such as //book[@category="fiction"]/title to navigate and filter a document tree — it is the backbone of web scraping, XSLT, and many testing tools.
Yes. Switch between XML mode (strict parsing, ideal for feeds, config, and API responses) and HTML mode (lenient parsing that mirrors how browsers read web pages). HTML mode is perfect for building and testing scraping selectors.
The tester uses your browser's native XPath engine, which implements the full XPath 1.0 specification — including all axes, predicates, and the standard function library (count, string, contains, starts-with, position, last, and more). XPath 2.0/3.1-only features are not supported, matching what browsers and most scraping libraries use.
No. Both parsing and XPath evaluation run entirely in your browser using built-in APIs. Your markup and expressions never leave your device, so it is safe for private or proprietary documents.
XPath expressions can return different types. count(//book) returns a number, string(//author) returns text, and contains(...) returns a boolean. The tool detects the result type automatically and shows the scalar value instead of a node list when appropriate.

Related Tools

JSONPath Tester

Test JSONPath queries against JSON live

Use Free

Regex Tester & Matcher

Real-time regex editor & visual tester

Use Free

Markdown to HTML Converter

markdown to html with preview

Use Free