XML Formatter & Validator
transform
output
indent
About the XML formatter
Parsing uses the browser's native DOMParser withapplication/xml MIME type, so validation errors are exact and standards-compliant. Formatting is a recursive serializer that preserves attributes, comments, and processing instructions while normalising whitespace. Minify strips all inter-element whitespace using XMLSerializer.
When to use it
XML still powers a surprising amount of infrastructure: configuration files, SOAP web services, RSS and Atom feeds, XML sitemaps, Android layouts, XAML, and SVG sources. If you have ever stared at a single line of minified machine-generated XML, this tool turns it into a readable tree in one click. It is also the quickest way to confirm whether a document is well-formed at all — a missing close tag surfaces as a parser error instead of a confusing failure further down your toolchain.
How this tool works
The document is parsed by the browser's native XML parser, then re-serialised with a custom recursive formatter that understands element nodes, text, comments, attributes, and processing instructions. The XML declaration is preserved when present, indentation is selectable (2 spaces, 4 spaces, or tab), and the live validity indicator updates as you type. All of it happens in this tab — nothing is uploaded or logged.
Edge cases and limitations
Namespaces are parsed and preserved correctly, and namespace declarations survive the round-trip. CDATA sections and entity references are resolved by the parser, so their text content is re-emitted rather than the literal <![CDATA[...]]>wrapper. This tool checks well-formedness — it does not validate against an XSD or DTD, so documents that are structurally valid but semantically wrong will still pass. Whitespace inside mixed content is normalised, which is almost always what you want.
Example
Paste a minified <catalog> document and hitFormat: each nested element moves to its own line with consistent indentation, making structure differences visible at a glance.
Related tools
For markup escaping rules that also apply inside XML text, see the HTML encoder. Need to compare two versions of a document? The XML difftool highlights what changed. If your data is JSON-shaped instead, the JSON formatterand JSON diff tools cover the other half of the config-world.
FAQ
Is my XML sent anywhere?
No. Parsing and formatting happen entirely in your browser — nothing leaves this tab.
Does it support namespaces?
Yes — the browser's DOMParser handles namespaced XML correctly, and the serializer preserves namespace declarations.