XML Formatter Converter
Indent XML properly, or collapse it onto one line.
XML
Formatted XML
About the XML Formatter converter
A SOAP response or a build file arrives on one enormous line and becomes unreadable. This formatter parses it and re-emits it with one element per line and consistent indentation.
Because it parses rather than pattern-matches, it also validates: an unclosed or mismatched tag produces a specific message naming the tag.
What gets normalised
Attribute values are re-escaped consistently, empty elements are written in self-closing form, and insignificant whitespace between elements is removed before re-indenting.
Comments and processing instructions are dropped. If you need them preserved, format the file in an editor instead.
Minify mode
Minifying removes whitespace between tags and strips comments while leaving text content untouched. It is useful when embedding XML in a field with a size limit.
Frequently asked questions
Can I format an SVG?
Yes. SVG is XML, and indenting one makes hand-editing paths and groups far easier.
Will it preserve the XML declaration?
Yes, if your input has one it is kept at the top.