XML Formatter & Validator
Paste XML to check that it is well-formed and re-print it cleanly, or squeeze it down to one line. Text, CDATA and entities are kept exactly as you wrote them.
- PrivateYour data never leaves this device
- No uploadsProcessed in your browser, not on a server
- 100% freeNo signup, no watermark, no trial
- UnlimitedUse it as often as you like, no daily caps
Options
XML input
Formatted XML
Output appears here.How to use the XML Formatter.
4 short steps. Nothing to install, nothing uploaded.
- 1
Paste your XML, click Open file, or press Sample to try it.
- 2
Choose Beautify (2 spaces, 4 spaces or tabs) or Minify.
- 3
Optionally remove comments, sort attributes A–Z or collapse empty elements like <a></a> into <a/>.
- 4
Copy the result or download it as a .xml file. If the XML is not well-formed, the error shows its line and column, and Go to error selects it in the input.
Guides for XML Formatter

XML to JSON: the complete guide to converting XML data
30 Nov 20266 min readLearn how to convert XML to JSON online: how attributes, text, repeated tags and namespaces are written, what each option does, and what…

XML Formatter: the complete guide to validating and beautifying XML
30 Nov 20267 min readA complete guide to formatting XML online: beautify or minify, pick the indent, sort attributes, strip comments, and read every…

JSON to XML: the complete guide to converting JSON data
30 Nov 20266 min readHow to convert JSON to XML online: how arrays, @attributes and #text are written, why a root element appears, how invalid key names are…
Frequently asked questions.
Quick answers about the XML Formatter.


