XML Formatter

Make nested XML easier to read. Check syntax, choose indentation, then copy or download the result.

Up to 200,000 characters. UTF-8 files up to 800,000 bytes. Output limit: 4,000,000 characters. Maximum nesting: 256 elements.

Download XML

Your source is processed in your browser and is not uploaded to ToolPixels. This tool does not save your input.

How to use it

  1. Paste XML or open a UTF-8 file. Load the example to try it.
  2. Choose indentation, then select Format XML.
  3. Review the output. If an error appears, correct your input and try again.
  4. Copy the result or download xml-formatter.xml.

Mixed content stays together

Element-only content gets indentation. Text mixed with child elements, CDATA sections, and xml:space="preserve" subtrees are left together. XML serialization may normalize quotes, entities, empty tags, and line endings. Added indentation is whitespace data: do not use this for signed XML or whitespace-sensitive documents.

DTDs and entity declarations are not supported. External documents are never loaded. Standard XML entities such as & and numeric character references are supported. Downloads use UTF-8; the formatter updates any encoding declaration accordingly.

Related developer tools