◨ DEVELOPER Updated July 25, 2026
XML Formatter
Indent and validate XML, or collapse it to one line.
XML
Result
Ad space · belowTool · horizontal
How it works
Your XML is parsed with the browser's native DOMParser, so malformed documents are reported with the parser's own message. Valid documents are re-serialised with one node per indented line.
Frequently asked questions
What counts as invalid XML?
Unclosed tags, mismatched names, stray ampersands, and multiple root elements will all be rejected — XML is much stricter than HTML.
Does it handle namespaces?
Yes. Namespace prefixes and xmlns declarations are preserved exactly as written.
Comments