Text UtilitiesText FormattersFree Tool
XML Formatter
Reformat XML with proper nested indentation based on tag depth — a lightweight tag-based indenter, not a full XML parser.
How to Use XML Formatter
- 1Paste your XML
- 2Click Convert
- 3Copy the indented output
Frequently Asked Questions
It splits your XML at every '><' boundary onto its own line, then increases indent depth on opening tags and decreases it on closing tags.
No — this tool only reformats indentation; it doesn't check for unclosed tags or syntax errors. Use the XML Validator tool in Developer Tools for a real well-formedness check.
Self-closing tags (ending in />) don't increase indent depth, which is handled correctly. Complex cases like CDATA sections may not indent perfectly, since this is a lightweight tag-splitter, not a full XML parser.
No — formatting happens entirely in your browser.
Related Tools
JSON Formatter
Pretty-print JSON with real 2-space indentation using the browser's native JSON parser — shows the exact parse error if your JSON is invalid.
JSON Minifier
Compress JSON to its smallest valid form by removing all whitespace, using the native JSON parser.
XML Minifier
Compress XML by stripping comments and collapsing whitespace between tags.
HTML Formatter
Reformat HTML with proper nested indentation based on tag depth — a lightweight tag-based indenter, not a full HTML parser.