About this tool
Paste a SOAP response, an RSS feed, an SVG or a config file and get it back indented one element per line, with short text-only elements kept on a single line. Comments, CDATA sections, processing instructions and the DOCTYPE are preserved. Minify mode strips the whitespace between tags instead. The document is checked for well-formedness first, and nothing is uploaded.
How to use XML Formatter
- Paste your XML into the left box.
- Choose Pretty-print or Minify.
- Set indentation and whether to keep comments.
- Copy the output or download it as an .xml file.
Frequently asked questions
Will formatting change my data?
Element names, attributes and text stay the same. Whitespace inside text is tidied, so if an element relies on exact spacing, such as xml:space="preserve", check it after formatting.
Why do I see an error instead of output?
The XML must be well-formed before it can be formatted. The message shows the line and column of the first problem, such as an unclosed tag.