XML Formatter
Format, validate, and beautify XML. Minify with one click. Syntax highlighting and error detection.
| Element | Syntax | Example |
|---|---|---|
| Declaration | <?xml ... ?> | <?xml version="1.0" encoding="UTF-8"?> |
| Element | <tag>...</tag> | <name>Alice</name> |
| Attribute | key="value" | <item id="1" type="book"> |
| Self-closing | <tag /> | <br /> <img src="a.png" /> |
| Comment | <!-- ... --> | <!-- This is a comment --> |
| CDATA | <![CDATA[ ... ]]> | <![CDATA[raw text]]> |
📝 Input XML
✨ Formatted Output
How to Use
- Paste your XML into the left panel
- Click ✨ Format / Beautify to pretty-print with proper indentation
- Or click 📦 Minify to compress into a single line
- Use ✅ Validate to check for syntax errors
- The output panel shows syntax-highlighted XML
- Click 📋 Copy or 💾 Download to export
What Is XML?
XML (eXtensible Markup Language) is a markup language for encoding documents in a format that is both human-readable and machine-readable. It's widely used in web services (SOAP), configuration files (Maven, Android), data interchange, RSS feeds, SVG, and many enterprise systems. Well-formatted XML is essential for debugging, API testing, and maintaining readable configs.