XML Formatter

Format well-formed XML with indentation while preserving mixed text and element content.

Workspace

Result

Your result will appear here.

How to use it

  1. Fill in xml, indent spaces.
  2. Select “Format XML” to see the result.

Worked example

Input
<catalog><item>Tea</item><item>Coffee</item></catalog>
Output
<catalog>
  <item>Tea</item>
  <item>Coffee</item>
</catalog>

Frequently asked questions

Will indentation change text inside an XML tag?

Mixed content and elements marked xml:space="preserve" are kept together to preserve their spacing.