XML Formatter
Format, indent and validate XML, with parse errors reported inline.
About this tool
XML still turns up everywhere it has always lived: SOAP envelopes, RSS and sitemap files, Android and Maven configuration, SVG source, Office document internals. Most of it arrives minified onto one enormous line, which makes finding a single wrong attribute genuinely painful. This XML formatter re-indents that line into a readable tree, and when the document will not parse it tells you what broke instead of silently producing nothing.
The formatting is deliberately conservative. Elements with a single text child stay on one line,
so <title>Dune</title> does not get split across three. Attributes keep
their original order, comments and CDATA blocks survive untouched, and empty elements collapse to
self-closing form. Everything happens locally through the browser's native XML parser — no upload,
no third-party library, and no round trip to wait on.
Frequently asked questions
Is my XML uploaded anywhere?
No. Parsing and formatting run in your browser through the built-in DOMParser, and the page makes no network request with your content. Load the page, disconnect from the network, and it keeps working — which matters when the XML is a SOAP response or a config file with credentials in it.
Why does it say my XML is invalid when it looks fine?
XML is stricter than HTML. The usual causes are an unescaped ampersand (write & instead of &), a tag that is never closed, two root elements where only one is allowed, and mismatched case in a closing tag. The error message names the first problem the parser hit, so fix that one and re-run.
Does formatting change what the XML means?
No. Only whitespace between elements is adjusted. Attributes, element order, comments and CDATA sections are preserved exactly. Text content is left untouched apart from trimming the surrounding whitespace, so significant text inside an element is never altered.
Can it handle namespaces and large files?
Namespace prefixes are preserved as written, since the formatter treats them as part of the tag name rather than resolving them. File size is limited by browser memory rather than an upload cap, so documents of several megabytes format without trouble on a normal machine.