XML Formatter
Free online XML formatter with two-space indent, preserved attributes, comments and CDATA, plus line-numbered errors.
Privacy: all processing happens locally in your browser. Your input never leaves your device.
What is XML Formatter?
Working with SOAP payloads, Maven pom.xml files or Android layouts, single-line XML is nearly unreadable. This tool formats XML with a clean two-space indent per level, fully preserving attributes, comments and CDATA; parse failures are reported with an exact line number. Reverse minification is supported too.
How to Use
- Paste XML content
- It formats automatically
- Copy the result
FAQ
- Is CDATA preserved?
- Yes. CDATA blocks are kept as-is — never escaped or split.
- What if formatting fails?
- Check the reported line number for common errors such as unclosed tags or unquoted attributes.
Related Tools
JS / TS FormatterFree online JavaScript and TypeScript formatter powered by Prettier, with JSX/TSX support and reverse minify — local.CSS FormatterFree online CSS formatter based on Prettier: restore single-line stylesheets to readable indented CSS, or minify.HTML FormatterFree online HTML formatter based on Prettier: re-indent tags, normalize attributes, format embedded script and style.SQL FormatterFree online SQL formatter for MySQL, PostgreSQL, SQL Server and SQLite: uppercase keywords and indented subqueries.
Last updated 2026-09-04