XML Formatter
Prettify and validate XML in the browser — syntax-highlighted output with line numbers and precise error locations.
FAQ
What does the XML Formatter do?
It parses your XML using the browser's native DOMParser, re-serialises it with consistent 2-space indentation, and applies syntax highlighting for tags, attributes, comments, and CDATA sections. If the XML is invalid it reports the error with line and column numbers.
Which XML features are supported?
The formatter handles standard elements and attributes, comments, CDATA sections, processing instructions, and the XML declaration. Namespace prefixes and DTD declarations are preserved as-is.
Is my data sent to a server?
No. All parsing and formatting happens in your browser using the built-in DOMParser API (powered by a Rust-based parser in Chrome 147+). Nothing is transmitted.
What file types can I upload?
Any XML-based file: .xml, .xsd (XML Schema), .xsl/.xslt (stylesheets), .svg, or plain .txt containing XML.