Skip to content
Burrows Tools

XML Formatter

Turn a single-line wall of XML into something you can actually read. Paste the document and this formatter indents each element by nesting depth, keeps attributes on their parent tag, and preserves the content of text nodes so meaning is not changed. It also minifies, stripping the whitespace between elements when you need the smallest possible payload. Malformed documents produce a readable error rather than silence, which is usually enough to spot an unclosed tag or a stray ampersand that should have been escaped. Everything happens in your browser using its own XML parser, so SOAP envelopes, RSS feeds, sitemaps, and Android layouts with anything sensitive in them stay on your machine.

XML is parsed in your browser — nothing is uploaded.

Paste XML and choose Beautify or Minify.

How to use the xml formatter

  1. Paste your XML into the input box.
  2. Choose Beautify to indent it, or Minify to strip whitespace between elements.
  3. Fix anything the error message flags, such as an unclosed tag or an unescaped & character.
  4. Copy the formatted XML back out.

Frequently asked questions

Does formatting change the meaning of my XML?
Element structure, attributes, and text content are preserved. Whitespace between elements is adjusted, which is insignificant in most schemas — but if your document relies on mixed content where spacing is meaningful, prefer the minified output.
Why is my XML reported as invalid?
The usual causes are an unclosed or mismatched tag, more than one root element, a raw & that should be written as &amp;, or a stray < inside text. The error message names the position so you can jump straight to it.
Can it format HTML too?
Only if the HTML is well-formed XML, such as XHTML. Ordinary HTML allows unclosed tags like <br> and <li>, which an XML parser rejects.
Is my XML sent to a server?
No. Parsing and formatting run entirely in your browser, so nothing is uploaded or logged.