XML Formatter & Validator
XML Formatter & Validator pretty print xml online check xml syntax private minify xml documentMake an XML document readable
Paste XML and choose Format and validate for indented output. Choose Minify to remove whitespace found only between elements, or Clear to empty both panels and remove any validation error. Invalid markup produces a parser error instead of repaired output.
Well-formed XML has strict rules
Every start tag needs a matching end tag unless it is self-closing. Attribute values require quotes, element names are case-sensitive, and a document must have one root element. Reserved characters inside text need entity references. These rules apply equally to SOAP envelopes, RSS feeds, SVG files, Android layouts, Maven files, and application configuration.
Worked example
A compact value such as <catalog><book id="7"><title>Maple</title></book></catalog> becomes a nested tree with the book and title indented beneath the catalog. Delete the closing title tag and validation fails because the elements are no longer balanced.
Whitespace can carry meaning
Formatting is safest for element-oriented data where whitespace between tags is presentation. In mixed-content XML, spaces around inline elements can be meaningful text. Minification can therefore change how prose-like XML renders. XML signatures and canonicalization are also byte-sensitive. Never reformat a signed document and assume its signature remains valid.
Privacy and limitations
Parsing happens locally with the browser XML parser. The tool does not fetch external entities, validate against XSD or DTD schemas, run XPath, transform XSLT, or determine whether an XML payload is valid for a particular API. It also does not repair malformed markup. Review namespace prefixes and application-specific requirements separately.
XML FAQ
Does this validate an XSD schema?
No. It checks whether the XML is well formed, not whether it follows a business schema.
Why might formatting affect text?
Mixed content can treat whitespace around child elements as part of the text value.
Can it open an XML URL?
No. Paste the content; the tool makes no network request.