XML Formatter
Format XML documents for readability.
Overview
This tool re-indents XML so nested structure becomes readable. It collapses
whitespace between tags, then places each element on its own line with
two-space indentation per depth level. XML declarations (<?xml ?>),
comments/doctypes (<!... >), and self-closing tags (<br/>) are handled;
short text content stays inline with its element. Useful for inspecting
minified SOAP responses, sitemaps, RSS feeds, or pom.xml-style configs.
How to use
- Paste your XML into the XML field — a single-line document is fine.
- The re-indented result appears in Formatted immediately as you type.
- Copy the output from the read-only field.
Examples
-
<root><item id='1'>a</item></root>→<root> <item id='1'>a</item> </root>
Notes
The formatter is structure-based, not a full XML parser: it does not resolve
entities, namespaces, or CDATA semantics, and it does not verify that tags
balance. Significant whitespace inside mixed content may be normalized, so
avoid formatting documents where inner whitespace is meaningful (e.g. certain
xml:space="preserve" sections).