XML Formatter & Validator - Beautify, Minify and Check Well-Formedness
XML arrives as one unreadable line from APIs and config exports. Paste it here to read it, shrink it, or find out why a parser rejected it.
How to use the XML Formatter & Validator
- Paste your XML.
- Click Format to beautify it, Minify to compress it, or Validate only to check it.
- Read the status line - it names the exact tag mismatch when the XML is broken.
- Copy the result.
How it works
Validation here checks XML well-formedness with a tag-stack parser: every opening tag must close in the correct order, self-closing tags and declarations are recognised, comments and CDATA sections are skipped correctly, and a raw < in text content is flagged because it must be escaped. That is the check every XML parser applies first - a document that fails it cannot be parsed at all. (It is not schema validation against a DTD or XSD, which needs the schema itself.) Formatting then re-indents by nesting depth; minifying removes the whitespace between tags.
Frequently Asked Questions
Is this formatter free?
Yes - completely free, no sign-up.
What does validation check?
Well-formedness: balanced, correctly nested tags and escaped text. It does not validate against a DTD or XSD schema.
Why did my XML fail?
The status message names the problem - usually a mismatched closing tag, an unclosed tag, or a raw & or < in text that needs escaping.
Does formatting change my data?
Only whitespace between tags. Element text and attributes are preserved exactly.
Is anything uploaded?
No. Parsing happens in your browser.