XML Formatter
Make nested XML easier to read. Check syntax, choose indentation, then copy or download the result.
How to use it
- Paste XML or open a UTF-8 file. Load the example to try it.
- Choose indentation, then select Format XML.
- Review the output. If an error appears, correct your input and try again.
- 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.