Skip to content
132 Free Online Tools • No Registration Required!
Contact

XML Formatter

Pretty-print XML with clean indentation: elements nested by depth, text content kept with its element, the XML declaration, comments and CDATA sections all handled properly.

  • 100% Free
  • No Registration
  • Works in Your Browser
XML Formatter

This tool's workspace loads here.

How to Use

  1. Paste your XML into the input box.
  2. Choose an indent size.
  3. Click Format XML.
  4. Copy the formatted result.

About This Tool

Pretty-print XML with clean indentation: elements nested by depth, text content kept with its element, the XML declaration, comments and CDATA sections all handled properly. Turn a one-line feed or config file into something a human can actually read.

Frequently Asked Questions

Does formatting change the XML data?

No. Only whitespace between elements changes; element text is preserved. Note that whitespace inside mixed content can be significant in some XML vocabularies — check documents like that after formatting.

Is my XML uploaded?

No. Formatting happens in your browser.

Can it format invalid XML?

It will lay out what it can tokenise, but for a correctness check use the XML Validator on this site.