XML Formatter & Validator
Format, validate, and minify XML, with clear error messages when something is wrong. Runs entirely in your browser.
XML is a text-based format used to structure data for configuration files, feeds, API responses, and document exchange between systems. Like JSON, XML follows strict syntax rules, an unclosed tag, mismatched opening and closing tags, or an invalid character will make the document invalid.
Paste your XML into the input box and click Format to have it validated and re-printed with consistent indentation, making deeply nested elements much easier to read. Choose between 2-space and 4-space indentation depending on your preference. If you need a compact version instead, for example to reduce payload size, click Minify to strip out all unnecessary whitespace and line breaks while keeping the structure identical.
If the XML contains a syntax error, the tool shows a clear error message describing what went wrong, using your browser's built-in XML parser, so nothing you paste is sent to any server.
What happens if my XML is invalid?+
You will see an error message describing what went wrong, using your browser's built-in XML parser to detect the issue.
Is my XML data uploaded anywhere?+
No. All formatting and validation happens locally in your browser, nothing is sent to a server.
Can I change the indentation?+
Yes, use the indent size selector to choose 2 or 4 spaces before formatting.
What is the difference between Format and Minify?+
Format adds line breaks and indentation to make the XML easy to read. Minify removes all unnecessary whitespace to produce the smallest possible output.