Format, beautify, minify and validate XML online. Shows where the XML is broken, keeps comments and CDATA, and runs entirely in your browser.
💡 Would you like a new tool or feature, or did something not work? Tell us at [email protected]
How to format XML
Paste your XML into the box, or load the example.
Click Format to indent it with the width you choose, or Minify to put it on one line without comments.
If the XML isn't well-formed, you'll see the browser's error and nothing is changed.
Where is XML used?
XML is still everywhere: electronic invoices, RSS feeds, sitemaps, Office files (inside), SVG images, Android and Maven configuration, and SOAP web services. Formatting it makes it easier to read and compare files that often arrive on a single line.
Frequently asked questions
Does formatting change my XML?
Only the whitespace between tags. Element names, attributes, text, comments and CDATA sections stay exactly as they are, so the formatted XML means the same thing.
How is the XML validated?
Your browser's own XML parser checks that the document is well-formed: every tag is closed, tags are nested correctly, attributes are quoted and there's a single root element. It doesn't check the document against a schema (XSD).
What are the most common XML errors?
A closing tag that doesn't match its opening tag, a missing closing tag, an unescaped & or < in text (write & and <), attribute values without quotes, and more than one root element.
Is my XML uploaded?
No. Formatting and validation happen entirely in your browser.