XML Formatter
runs in your browserno sign-upfree
Format messy or minified XML into clean, indented markup, keeping comments and CDATA.
Valid XML · formatted
About this tool
This XML formatter turns minified or messy XML into clean, indented markup that is easy to read. Short elements stay on one line, and comments, CDATA sections, the XML declaration and DOCTYPE are kept. The XML is checked first, so any error is shown with its line and column.
How to use
- Paste your XML into the XML box.
- Choose an indent of 2 spaces, 4 spaces or a tab.
- Copy the formatted XML or download it as an .xml file.
FAQ
Does formatting change my data?
Only the whitespace between tags and inside tags (like extra spaces between attributes) changes. Element names, attributes, text, comments and CDATA stay the same. Leading and trailing spaces inside short text elements are trimmed.
Can it format SOAP, RSS, SVG or sitemap files?
Yes. They are all XML, so any well-formed file can be formatted.
Why does it say my XML is invalid?
Usually a tag that is not closed, closing tags in the wrong order, an attribute value without quotes, or an & that should be written as &. The status line shows where the problem is.
Is my XML uploaded?
No. Everything runs in your browser, so your XML never leaves your device.