XML Formatter & XPath Tester

Pretty-print or minify XML, find well-formedness errors and test XPath.

Runs locally · nothing uploaded
XML
Result
XPath

What it does

Paste XML (a SOAP response, a web.config, a .csproj, an RSS feed) and get it indented and checked as you type. If the document isn’t well-formed, you see the line, column and the parser’s message, with a snippet pointing at the problem.

Features

  • Pretty-print or minify with 2 spaces, 4 spaces or tabs, and optionally one attribute per line for elements with many attributes.
  • Nothing is lost: the XML declaration, DOCTYPE (including an internal subset), comments, CDATA sections and processing instructions are kept. Turn off Keep comments to strip them.
  • Safe with text: elements that contain only text are left on one line exactly as written, mixed content (text with inline elements) is not re-indented, and xml:space="preserve" is respected.
  • XPath 1.0 tester: type an expression and see every matching node with its path (/orders/order[2]/customer), or the number, string or boolean result. Namespace prefixes declared in the document work directly (//pay:payment), and a default namespace is mapped to the prefix d: for you.
  • Stats: input and output size, element and attribute counts and nesting depth.

How to use it

Paste or drop a file, pick Pretty or Minify, then copy or download the result. Type an XPath expression in the box below the output to query the document.

Privacy

Parsing uses your browser’s built-in XML parser and XPath engine. Nothing is uploaded, and your last input and expression are kept in local storage.