XML Formatter
Free online XML formatter and parser: paste XML to parse and pretty-print it, check it for errors, or minify it — right in your browser.
Suggested tools
About XML Formatter
XML Formatter beautifies, minifies and validates XML — sitemaps, RSS feeds, SOAP envelopes, WSDL files, Android layouts, Maven POMs and any other XML. Beautify adds clean indentation; Minify removes whitespace between tags; Validate checks that the document is well-formed.
It also works as an online XML parser: the document is parsed before formatting, so errors such as an unclosed tag are reported with their line. Element order and attribute values are preserved exactly. It runs entirely in your browser, so nothing you paste is uploaded.
How to use XML Formatter
- Paste XML, upload a file or click Sample.
- Press Beautify, Minify or Validate.
- Copy or download the result.
Key features
- Beautify, Minify and Validate
- Works with SOAP, WSDL, RSS and sitemaps
- Element order preserved
- Clear well-formedness errors
Example
One-line XML, indented so the structure is easy to read.
<note><to>Team</to><from>Asha</from><body>Release on Friday</body></note>
<note> <to>Team</to> <from>Asha</from> <body>Release on Friday</body> </note>
When to use XML Formatter
- Reading SOAP responses, sitemaps or RSS feeds that arrive on one line.
- Tidying Maven, Android or other XML config files.
- Checking that XML is well-formed before sending it to an API.
Tips and common problems
- Validate tells you the line of the first problem — fix it and validate again.
- A bare & is the most common error; write it as &.
- Minify before embedding XML in another file or a request body.
Frequently asked questions
Yes — they are XML documents, so they format like any other XML.
It checks well-formedness (correct XML syntax). Validation against a schema needs the XSD and a schema validator.
A bare & is not allowed in XML. Write it as & — XML Escape can do this for you.