XML Formatter & Validator
Make XML readable with proper indentation, check that it is well-formed, or minify it to save space. Handy for sitemaps, RSS feeds, SOAP messages, SVG files and configuration.
Free · No sign-up · Files stay on your device
How to use XML Formatter
- 1Paste your XML or open an .xml file.
- 2Click "Format" to indent it, or "Minify" to compress it.
- 3If the XML is invalid, read the error to find the problem.
- 4Copy or download the result.
Features
- Beautify with 2 spaces, 4 spaces or tabs
- Minify to a single line
- Validation with readable error messages
- Keeps comments, CDATA and the XML declaration
- Runs in your browser; nothing is uploaded
What makes XML well-formed?
Every opening tag needs a matching closing tag, tags must be nested correctly, attribute values must be quoted, there must be exactly one root element, and special characters like & and < must be escaped as & and <.
Formatting sitemaps and feeds
XML sitemaps and RSS feeds are usually generated as one long line. Formatting them makes it easy to check that every URL, date and title is correct before submitting a sitemap to Google Search Console.
Frequently asked questions
Does formatting change my data?
No. Only whitespace between tags changes. Element names, attributes, text and comments stay the same.
Can it validate against a schema (XSD)?
It checks that XML is well-formed, which catches most errors. Validation against an XSD schema is not supported.
Is my XML uploaded?
No. Parsing and formatting happen entirely in your browser.