Indenting a compact document
<catalog><book id="b1"><title>Learning XML</title></book></catalog><catalog>
<book id="b1">
<title>Learning XML</title>
</book>
</catalog>Make XML from APIs, sitemaps, RSS feeds and config files readable again. Paste XML to get neatly indented output as you type, with errors pointed out by line — or minify it into a single line for smaller payloads.
<catalog><book id="b1"><title>Learning XML</title></book></catalog><catalog>
<book id="b1">
<title>Learning XML</title>
</book>
</catalog><order><item>Pen</order>An error is reported because <item> is never closed before </order>.Comments, CDATA sections, processing instructions and the XML declaration are kept. Elements that contain only text stay on one line, and elements that mix text and tags — such as <p>Hello <b>world</b></p> — are left exactly as written, because adding line breaks inside them would change the text.
XML is checked with your browser’s built-in parser. It doesn’t load external files or execute anything, so formatting untrusted XML is safe.
No. Formatting and checking happen in your browser on your own device.
Every tag is closed and properly nested, there is a single root element, attribute values are quoted and special characters such as & are escaped. Well-formed XML can be read by any XML parser.
No. It checks that the XML is well-formed, which catches most errors. Schema validation, which checks allowed elements and values, needs the schema itself.
Only whitespace between tags changes. With “Trim spaces around text values” on, leading and trailing spaces inside text-only elements are removed; turn it off if those spaces matter.
Everything you need. One simple place.
Free, fast online tools for text, PDFs, images, data and everyday maths. Every tool runs entirely in your browser, so your files stay on your device.
© 2026 Toolora. All rights reserved.
Built for speed and privacy