Beautify or minify XML with proper indentation.
Processed locally in your browser.
How do you format XML?
Beautify mode tracks each element's depth and indents nested tags accordingly for readability; minify mode strips the whitespace between tags to shrink the file. The markup is reformatted but not validated against a schema. For example, <note><to>Tove</to></note> becomes a neatly indented, multi-line document. It works on well-formed XML, entirely in your browser.
Understanding your result
The formatter splits the XML into tags and text, then rebuilds it with consistent indentation or with the spacing removed. It works on well-formed markup; it does not check that the XML is valid.
Formula and method
Beautify tracks element depth and indents each tag accordingly; minify removes the whitespace between tags. The markup is reformatted but not validated against a schema.
Worked example
<note><to>Tove</to></note> becomes a neatly indented, multi-line document.
How to use this tool
- Paste your XML.
- Choose beautify or minify.
- Copy or download the formatted XML.
Common mistakes to avoid
- Expecting it to fix broken or invalid XML — it formats, not validates.
- Pasting HTML and expecting XML rules to apply.
About the XML Formatter
The XML Formatter tidies XML markup. Beautify mode indents nested elements for readability; minify mode strips the whitespace between tags to shrink the file.
Who should use this tool
Developers, integrators and anyone reading or shipping XML, RSS or config files.
Benefits
- Beautify with 2 or 4-space indentation.
- Minify to remove whitespace.
- Runs locally — nothing is uploaded.
- Copy or download the result.
Practical use cases
- Making minified XML readable.
- Shrinking XML before sending it.
- Inspecting an API or RSS response.
Explore all Developer Tools tools
Frequently asked questions
Does it validate my XML?
No. It reformats the markup for readability or size but does not check it against a DTD or schema.
Is my XML uploaded?
No. Formatting happens entirely in your browser, so your data stays on your device.