DEVELOPER TOOL

XML Formatter & Validator

Format, validate, and minify XML with clear error messages.

About this tool

Paste any XML to check whether it's well-formed and see it reformatted with clean, readable indentation. If something's wrong, the error message tells you roughly where the problem is. Minify strips all unnecessary whitespace for the smallest possible output.

Parsing uses your browser's built-in XML parser, so nothing is uploaded — everything happens locally.

Frequently asked questions

What counts as invalid XML?
Common issues include unclosed tags, mismatched opening/closing tags, multiple root elements, and unescaped special characters like a bare & or < inside text content.
Does this validate against a schema (XSD/DTD)?
No — it only checks that the XML is well-formed (valid syntax), not that it conforms to a particular schema or set of allowed elements.
Are comments and CDATA sections preserved?
Yes — comments and CDATA sections are kept in both the formatted and minified output.