XML Formatter & Validator
Paste XML to pretty-print it, minify it or check that it is well-formed. Errors show the line and column. External entities and DTDs are never loaded.
Runs in your browser — nothing is uploaded.
How to use it
- Paste your XML on the left and press Format, Minify or Validate.
- If it is not well-formed, the message gives the reason, line and column of the first problem.
- Pick the indentation, and tick “Remove comments” if you want them dropped.
- Copy the result or download it as an .xml file.
Frequently asked questions
Is my XML uploaded?
No. Everything runs in your browser and nothing is sent anywhere. Very large documents are processed in a background worker.
Does it load external entities or DTDs?
Never. A DOCTYPE and its entity declarations are kept as plain text and never fetched, so XXE-style tricks (such as an entity pointing to a local file) have no effect.
What does Validate check?
That the document is well-formed: one root element, matching tags, quoted unique attributes, valid comments and CDATA, and escaped & and <. It does not validate against a schema (XSD) or DTD.
Does formatting change my content?
Only whitespace between tags is added. Elements that mix text and child tags (such as <p>Hello <b>world</b></p>) are left exactly as written, so their text does not change.
Why does the browser disagree with the validator?
After the check above, Validate also asks your browser’s own XML parser. If it finds a problem the scanner missed, its message is shown.