XML formatter online

Indent and lay out your XML to make it readable — the syntax is validated along the way.

🔒 Formatted 100% locally — your XML is never uploaded.

Formatting is also a validity check

An XML document that cannot be parsed cannot be indented, so a formatter is a validator that happens to produce readable output. If this page returns your document laid out on multiple lines, the syntax is sound: tags are balanced, attributes are quoted, the entities resolve.

If it refuses, the problem is structural — most often an unclosed tag, an unescaped &, or two root elements where XML permits exactly one.

Why minified XML exists in the first place

Machines do not need whitespace, and APIs strip it to save bandwidth. A SOAP response or a sitemap arrives as one endless line because that is cheaper to transmit. It becomes a problem the moment a human has to read it — which is exactly when something has gone wrong and you are debugging.

Indenting changes nothing semantically: whitespace between elements is not data. You can reformat a document freely without altering what it means.

Frequently asked questions

Does indenting change my data?

No. Whitespace between elements carries no meaning in XML, so the document is semantically identical.

Why is my file rejected?

Usually an unclosed tag, an unescaped ampersand, or more than one root element. XML allows exactly one.

Can it handle very large files?

It can, but formatting runs in your browser, so a file of several megabytes will be slow.

Related tools