DevToolStation

Format & Convert

XML Formatter & Validator

Pretty-print, minify and validate XML with the exact line and column of any error.

Loading the XML Formatter & Validator…

About the XML Formatter & Validator

Pretty-print or minify XML and check that it is well-formed. Errors are reported with their line and column. The formatter keeps the XML declaration, DOCTYPE, comments, CDATA sections, processing instructions and namespaces, and leaves mixed content (text with inline elements) exactly as written.

How to use it

  1. Paste XML or open an .xml, .xsd, .wsdl or .svg file.
  2. Choose an indentation or Minify, and optionally remove comments.
  3. Copy or download the result.

Frequently asked questions

What does "well-formed" mean?
Every tag is closed and properly nested, attribute values are quoted, there is exactly one root element and special characters are escaped. This tool checks well-formedness; it does not validate against an XSD schema.
Is it safe to paste XML from an untrusted source?
Yes. The browser parser never loads external entities or DTDs, so XXE attacks cannot read files or make requests.
Is my XML uploaded?
No. Everything runs in your browser tab with JavaScript. Nothing you enter is uploaded, logged or stored, and the page works offline once loaded.