How to format XML
- Paste your XML: a sitemap, RSS feed, SVG, config file, SOAP message or any other XML.
- Choose Format to indent it with one element per line, or Minify to put it on one line.
- If the XML isn’t well-formed, the error tells you which line to fix.
Common XML errors
- A tag isn’t closed: every
<item> needs a </item>, or write it as <item/>.
- A bare & or < in text: write
& and <, or wrap the text in <![CDATA[ … ]]>.
- More than one root element: wrap everything in a single outer element.
- Unquoted attributes:
id=5 must be id="5".
Frequently asked questions
Does it check that my XML is valid?
It checks that the XML is well-formed: every tag is closed, tags are nested properly, attributes are quoted and there's one root element. If not, it shows the browser's error with the line to look at. It doesn't validate against a schema (XSD or DTD).
Are comments and CDATA kept?
Yes. Comments, CDATA sections, processing instructions and the XML declaration are kept when formatting. Minify can remove comments too.
What does minify do?
It removes the whitespace between tags, and optionally comments, to make the file as small as possible. Text inside elements is kept exactly.
Is my XML uploaded?
No. Formatting runs in your browser, so it's fine for config files, sitemaps, feeds and SOAP messages with private data.