XML formatter & validator
Validate XML and format it with two or four spaces in your browser. Preserve mixed content and inspect errors without uploading your XML. Free and ad-free.
Enable JavaScript to use this interactive tool. Paste input, choose options, then copy or download the result, or save it to your notebook.
Details and limits
Validate and indent XML locally. Mixed content and xml:space="preserve" regions keep their source text. DTDs/entities are not resolved; DOCTYPE declarations are rejected.
Example and common questions
Indent an XML document
- Indent spaces
- 2
<release><status>ready</status></release><release>
<status>ready</status>
</release>What is validated?
The formatter checks XML well-formedness and namespace parsing. It does not validate a document against an XSD schema.
Why is some text not re-indented?
Mixed content and xml:space="preserve" regions retain their source text so indentation does not change meaningful spacing.
Are external entities fetched?
No. DOCTYPE declarations are rejected and external entities are not resolved or fetched.
Common errors and limitations
Check mismatched tags, malformed attributes and namespace declarations. Documents containing a DOCTYPE are rejected; remove it only if the remaining document is appropriate for your use.