XML Formatter

Format, validate and query XML with XPath — every parse runs in your browser.

idle
0
Elements
0
Attributes
0
Max depth
0ms
Parse time
XPath cheatsheet
/bookRoot book element only //bookAll book elements anywhere book/titleDirect title children of book book[@lang='en']Books whose lang attribute equals en book[1]First book child book[position()<3]First two book children count(//book)Number of book elements //book/@idAll id attributes on books text()Text node of the current element name(.)Name of the current element

What is this XML formatter?

This is a free online XML formatter that pretty-prints, minifies and validates XML — and runs XPath queries against it — entirely in your browser, with zero data uploaded, so even confidential configuration and SOAP payloads stay private.

How do I format and validate XML online without uploading it?

Paste XML into the editor and click Run. It validates against the W3C parser, pretty-prints with proper indentation, and lets you query nodes with XPath — everything happens locally in your browser.

Key features

Pretty-print and minify
Switches between formatted and minified XML with configurable 2-space, 4-space or tab indent.
Strict W3C validation
Errors are surfaced with line and column from the native browser XML parser used by the DOM.
XPath queries
Run XPath 1.0 expressions against the document and inspect each returned node in a structured list.
100% client-side
Parsing, validation and XPath all run in your browser via DOMParser and document.evaluate — nothing is uploaded.

How to use it

Paste the XML in the editor pane and click Run. View the formatted output, switch to Minify to compress, or jump to the XPath box, type an expression like //book[@id] and inspect each match in the results panel.

Frequently asked questions

Does it support namespaces?

Yes. The browser XML parser preserves namespaces, and the XPath box lets you bind prefixes for query expressions that target namespaced elements.

Is my data uploaded?

No. Parsing, formatting and XPath evaluation all run inside your browser tab; the page never sends your XML anywhere.

Can it handle large files?

Yes, but XPath against very deep trees is bounded by your browser's memory. For multi-MB documents close other tabs first.

Toolbox uses the browser's built-in DOMParser, XMLSerializer and document.evaluate APIs, the same parser the rest of the Web platform relies on, so the formatting and validation results match what your application would see.