Skip to content
Mediawand

XML Formatter and Validator

Make XML from feeds, sitemaps, SOAP messages, SVGs or config files readable, or squeeze it onto one line. Broken XML is caught with the line and column of the problem.

How to format XML

  1. 1Paste your XML or open an .xml file.
  2. 2Choose Format or Minify, the indent, and whether to keep comments.
  3. 3Copy the result or download it.

Errors you can find

Mismatched tags, tags that are never closed, closing tags without an opening one and attribute values without quotes are reported with the line, the column and a pointer.

Tidy output

Elements that hold only text stay on one line, like <title>Midnight Rain</title>, while elements with children are indented. CDATA sections, comments and the XML declaration are kept as they are.

Minify

Minify removes the spacing between elements, which shrinks files that are sent over the network or embedded in code.

Frequently asked questions

Is my code uploaded?
No. Everything runs in your browser, so your code never leaves your device.
Does it check the XML against a schema?
No. It checks that the XML is well formed (every tag closed and nested properly), not that it matches an XSD or DTD.
Is text inside elements changed?
Only spacing at the start and end of text is trimmed when formatting. Entities like &amp; stay as written.

Related tools

Loading tools…