XML Formatter and Validator: Beautify and Check XML

Paste XML and get clean, indented XML. If a tag is missing or a character is wrong, you see exactly where.

XML often arrives on one line, or with a missing closing tag or an unescaped & character. Reading it is hard, and one error can stop a system from accepting the file.

The XML Formatter adds clean indentation, or minifies the text to save space. You can sort attributes and keep or remove comments. If the XML is not well-formed, it shows the line and column of the first problem.

Everything runs in your browser, so your XML is not sent anywhere.

Open the XML Formatter

How to use the XML Formatter: step by step

  1. Open the XML Formatter.
  2. Paste your XML, or upload an .xml file.
  3. Choose Beautify or Minify.
  4. Fix any error shown, then copy or download the result.

When to use the XML Formatter

  • Reading a SOAP or API response
  • Checking a config or sitemap file
  • Finding a missing closing tag
  • Making a small XML file for production

Tip: Use "Sort attributes" to make two XML files easy to compare.