XML Formatter & Validator


About this tool

XML never really went away: sitemaps, RSS feeds, SVG files, Office documents, SOAP APIs, and countless configuration files are all XML under the hood. But XML as it arrives is often a single unreadable line, or worse, subtly invalid. Paste it here to pretty-print it with your choice of indentation, or to minify it down for transfer. Every input is validated as it is parsed, and when something is wrong you get the parser’s actual error message instead of a silent failure — usually pointing at the exact line where a tag was not closed or an ampersand was not escaped.

The formatter understands the full XML structure: declarations, comments, CDATA sections, and nested elements are all preserved and re-indented correctly, while insignificant whitespace between tags is normalized. Minify mode strips that whitespace for the smallest possible payload. If your data is JSON rather than XML, the JSON Formatter on this site is the matching tool. Validation and formatting both run entirely in your browser via the built-in XML parser — your documents are never uploaded.

Privacy: all processing happens in your browser. Nothing you paste is uploaded or stored.