1. Home
  2. Coding Tools
  3. XML Formatter & Validator

XML Formatter & Validator

Beautify XML with proper indentation, check whether it is well-formed with clear error messages, or minify it to a single line.

Runs locally in your browser. Your files and data are never uploaded or stored.

About the XML Formatter & Validator

XML is used for sitemaps, RSS feeds, SOAP APIs, Android layouts, office documents and countless configuration files. The XML Formatter & Validator makes XML readable by placing each element on its own line with consistent indentation, while keeping short text values on the same line as their tags.

Before formatting, the XML is checked by your browser's built-in XML parser. If the document is not well-formed, for example because of a missing closing tag, an unescaped ampersand or mismatched quotes, you get the parser's error message so you can fix it. You can also minify XML to reduce its size by removing whitespace between tags and comments.

How to use the XML Formatter & Validator

  1. Paste your XML.
  2. Click Format to beautify or Minify to compress.
  3. Read the validation message and fix errors if needed.
  4. Copy or download the result.

Frequently asked questions

What does "well-formed" mean?

Every tag is properly closed and nested, attribute values are quoted and special characters like & are escaped. Well-formed does not mean valid against a schema.

Does it validate against an XSD schema?

No. It checks well-formedness only, which catches most syntax errors.