Send feedback

Coming from the page: XML Formatter

One moment…

Errors by line & columnMinify optionRuns in your browser

XML Formatter

Paste XML or open a file: we indent it cleanly and tell you where any error is.

Everything runs in your browser: no text or file is uploaded to any server.

How to use it

1

Paste or open a file

XML, SVG, RSS, a sitemap.xml or any other XML file.

2

Validate

Your browser’s XML parser checks the file. If there is an error, you get the line, column and the parser’s message.

3

Copy or download

Pick the indent or minify, then copy or download the result.

Common XML errors

ErrorExampleFix
Unclosed tag<a><b></a><a><b></b></a>
Bare ampersand<t>A & B</t><t>A &amp; B</t>
Unquoted attribute<a id=1><a id="1">
More than one root<a/><b/>Wrap them in one element
Case mismatch<Item></item>XML is case-sensitive: use the same name

Good to know

Mixed text stays as is. Inside an element that mixes text and tags, like <p>Hello <b>you</b></p>, we add no whitespace that could change the meaning; the same for xml:space="preserve".

Encoding. The output is always UTF-8; an encoding="..." in the declaration is rewritten to UTF-8 to match the saved file.

DTD entities. Entities defined in the DOCTYPE are replaced by their values in the output; the DOCTYPE itself is kept.

FAQ

What is XML?

A markup language for data, with opening and closing tags like HTML but with tag names you choose. Sitemaps, RSS, SVG, e-invoices and many systems use it.

How do I find the error in an XML file?

Paste it here: you get the line and column and the parser’s message, plus a “Go to the error” button. With unclosed tags the parser may point to where it noticed the problem rather than where it began.

Does formatting change my data?

No. Only whitespace between tags that hold no text is added or removed; text, attributes, comments and CDATA stay the same.

Is my file uploaded?

No. Validation and formatting happen in your browser; your file never leaves your device.