XML Formatter and Validator
XML from a SOAP response, a sitemap, an RSS feed or an export file often arrives as one long line. This tool puts each element on its own line and indents two spaces per nesting level so the structure becomes visible. It also checks whether the XML can be parsed; if it cannot, you are told instead of silently receiving a mangled result. XML is stricter than HTML: every opened element must be closed, tags are case-sensitive, and the less-than, greater-than and ampersand characters must be written as entities inside text content. That strictness is exactly what makes a formatter useful — an error stands out the moment the indentation drifts. Everything happens locally in your browser: your XML never reaches our server, is never logged and never stored, so an export with real data is fine to paste here. Free and unlimited to use, including commercially — no account, no licence, no limits.
What people use this for
<order id="42"><item>Book</item><item>Pen</item></order>Each element on its own line, two spaces per levelUnclosed tag → a message instead of a mangled result
What others think of this tool
No reviews for this tool yet. Yours would be the first.
Do you work with Westcube?
Leave a review on Google tooFrequently asked questions
Why is my XML invalid when it works fine as HTML?
XML is stricter. In HTML you may leave a br or img tag unclosed and the browser tolerates case differences between opening and closing tags. In XML every element must be closed — or end in a slash as a self-closing element — and Element and element are two different names. On top of that, the less-than, greater-than and ampersand characters must be written as entities inside text: a bare ampersand in a text value is the most common cause of an unexpected parse error.
Are my attributes and namespaces preserved?
Yes. The tool changes whitespace only: attributes, their order, namespace prefixes and the XML declaration at the top stay exactly as you entered them. Nothing is rewritten, merged or dropped. That is deliberate — a formatter that silently normalises your namespaces can produce a file the receiving party no longer accepts.
Can I use this to inspect a sitemap or RSS feed?
Certainly, both are simply XML. A sitemap with hundreds of URLs becomes readable here so you can check that the expected elements are present. If you are specifically checking a sitemap, look for a loc element per URL and whether lastmod values are there — the latter is the only change signal Google actually acts on.
What happens to a CDATA block or a comment?
They are preserved. A CDATA block by definition holds text that must not be read as markup, so it is not indented; the content comes out unchanged. Comment blocks are likewise kept and receive the indentation of the level they sit at. If something does disappear, the cause was the input rather than the formatting — check that the block is correctly opened and closed.