XMLXML Formatter
Pretty-print and indent messy XML, with basic validation.
Runs entirely in your browser — nothing is uploaded.
Half the value here is not the formatting. It is that the document has to parse before it can be laid out, so a failure tells you something real — the XML is not well-formed, and whatever downstream system rejected it was right to.
When an API keeps returning an error you cannot explain, pasting the request body in here takes ten seconds and rules out the boring cause.
Why documents fail
Almost always an unescaped ampersand or angle bracket sitting in text content, or a tag that was never closed. XML is far stricter than HTML about both: every element closes, attribute values are quoted, and there is no forgiving parser to rescue you.
The validation here uses the browser DOMParser, which checks well-formedness. That is not the same as checking against a schema — a document can be perfectly well-formed and still be rejected for having the wrong elements in it.
Minifying
Stripping whitespace between elements does not change meaning. Whitespace inside text content is data, though, and some documents depend on it, so verify anything where the formatting is significant rather than decorative.
What it will not do
Real-world HTML. Unclosed list items and bare attributes are legal HTML and illegal XML, so anything scraped from a live page will usually fail here.
Why a local tool for this
SOAP responses, sitemaps and configuration files routinely contain endpoints, internal hostnames and identifiers you would rather not paste into a stranger’s server. Everything on this page runs in the browser and nothing is uploaded, which is the main reason to prefer it over the first result in a search.
This tool is provided free of charge for general information and convenience only. It runs in your browser and we do not store the data you enter. We make no guarantee as to the accuracy, completeness, or suitability of any result, and accept no liability for any loss, damage, or decision arising from its use — use it at your own risk. See our Terms & Conditions.