</> XML Formatter & Validator
Format, beautify, minify and validate XML. Runs entirely in your browser.
Last updated: November 8, 2026 · By the BoltQuickTools team
Make a single-line XML response readable
SOAP replies, RSS feeds, sitemaps and exported config often arrive as one unbroken line. To find an element or a broken tag you need it indented, and when something refuses to load you need to know whether the XML is even well formed. This page does both using your browser's built-in XML parser.
Buttons and views
Paste into Input. Pasting runs Beautify automatically; typing does not, so press the button after typing. The Indent menu offers 2 Spaces, 4 Spaces or Tab. Minify strips the layout whitespace, and Validate checks the input without changing the output. Sample loads a test catalog, Copy copies the result and Clear empties the input and the output.
The output has three tabs. Formatted is the plain text, Highlighted adds colour, and Tree View has arrows that fold any element with child elements.
Indenting a one-line order
This input:
<order id="7"><item sku="A1" qty="2">Widget</item><item sku="B2"/><!-- gift --></order>
Beautified with 2 Spaces, it reports "Valid XML - Beautified" and gives:
<order id="7">
<item sku="A1" qty="2">Widget</item>
<item sku="B2"/>
<!-- gift -->
</order>
What Beautify changes beyond indentation
The output is rebuilt from the parsed document, so it can differ in meaning from your input. These cases were run through the page's own code:
| Input | Beautify output |
|---|---|
<p>Hello <b>big</b> world</p> | Each piece on its own line, with new whitespace added around Hello, <b>big</b> and world |
<a><![CDATA[1 < 2]]></a> | The CDATA moves to an indented line of its own, adding whitespace to the element's text |
A <!DOCTYPE ...> line | Removed from the output with no warning |
<a>© <</a> | <a>© <</a>, with numeric references turned into the characters |
<a x='1' y="2"></a> | <a x="1" y="2"/> |
The XML declaration, comments, attribute order and namespace prefixes are kept. If whitespace in your text content matters, as in document-style XML, avoid pasting the beautified result back into production.
Minify works on the raw text
Minify checks that the XML parses, then applies text replacements to your original input. It does not know where it is in the document, so it can alter content:
- Line breaks inside text disappear with no space added.
Line oneandline twoon separate lines becomeLine oneline two. - Comments and CDATA are not protected. Multiple spaces collapse to one and line breaks are removed inside them too.
- A space between inline elements is removed, so
<b>a</b> <i>b</i>becomes<b>a</b><i>b</i>.
Use it on data-style XML where the text values sit on one line. Unlike Beautify, it leaves a DOCTYPE in place.
Schemas, error wording and conversion
Does Validate check my XML against a schema?
No. It checks that the document is well formed: tags balance, attributes are quoted, and so on. It does not read XSD or DTD rules, so a document with the wrong elements in the wrong order still passes.
Why does the error message look different on another computer?
Errors come from the browser's own parser, and Chrome, Firefox and Safari word them differently. Line and column numbers appear when the message contains them.
Why is a document containing a parsererror element rejected?
The page detects failure by looking for an element with that name, so a valid document that really uses <parsererror> is reported as invalid.
How do I convert XML to another format?
The JSON and XML converter goes both ways. For HTML rather than XML, use the HTML beautifier, since browsers treat HTML far more loosely and this page rejects unclosed tags such as <br>.