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
  1. 1Paste your XML
  2. 2Click Convert
  3. 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

Related Articles

More from Text Utilities