Home › Formatters › XML Formatter

XML Formatter

Turn a wall of XML into a structured document with consistent indentation, one element per line, so you can see the hierarchy at a glance.

XML Formatter

How to use the XML Formatter

  1. Paste your XML into the input box.
  2. Pick an indent style.
  3. Press Format to generate the indented document.
  4. Copy or download the result.

About this tool

XML shows up in feeds, config files, office documents and SOAP APIs, usually with no whitespace at all. This formatter walks the document element by element and rebuilds it with even indentation, keeping attributes, comments, CDATA sections and self-closing tags intact. Elements that contain only text stay on one line, the way you would write them by hand.