XML
XML Formatter
Minify, beautify and validate XML.
About XML formatting
XML holds structured data in nested tags. Beautifying re-indents a document so its hierarchy is readable; minifying strips the whitespace between tags so it travels smaller. Input is checked for well-formedness first, so unclosed or mismatched tags are reported rather than silently repaired.
Two XML features are easy to lose sight of when formatting: namespaces (xmlns:prefix="...") and CDATA sections (<![CDATA[ ... ]]>), which wrap text that should never be parsed as markup — commonly used for embedding HTML fragments or code samples inside an XML document. Both are preserved exactly as written; only the whitespace between elements is touched. Self-closing tags like <br/> are also left in whichever form — self-closed or with an explicit closing tag — you originally wrote them in.
Where you'll run into it
- Reading SOAP requests and responses while debugging a web service
- Inspecting configuration files such as pom.xml or web.config
- Checking an RSS, Atom, or sitemap feed before publishing it
- Shrinking XML payloads before sending them over the network
Frequently asked
Does this validate against a schema?
No. It checks that the document is well-formed — tags closed and properly nested, attribute values quoted. Validating against a DTD or XSD is a separate step this tool does not perform.
Will formatting change my data?
Only the whitespace between elements changes. Text content, attributes, comments, and the XML declaration are all preserved as they were.
Is my XML stored?
No. Conversion happens on the server for that one request only; nothing is logged or kept afterward.
Are namespaces and CDATA sections preserved?
Yes, completely untouched. A CDATA section's entire point is to hold text that should never be interpreted as markup — often an embedded HTML fragment or a code sample — so this tool leaves its contents exactly as written, including any whitespace inside it. Namespace declarations and prefixes are ordinary attributes and element names as far as formatting is concerned, so they pass through unchanged as well.