XML Formatter & Validator
Check well-formed XML and format element-only content with two or four spaces. Preserve mixed text and xml:space blocks without executing XML content.
Paste input or try the example.
Checks XML well-formedness, not XSD/schema validity. DTD/entity declarations are rejected. Mixed-content and xml:space="preserve" blocks stay unindented. Serialization may normalize spelling.
Open a UTF-8 text file
Using XML Formatter & Validator
Check well-formed XML and format element-only content with two or four spaces. Preserve mixed text and xml:space blocks without executing XML content.
- Paste your input, open a UTF-8 file or load the example.
- Choose the operation and settings, then click Process XML.
- Read the status and limitations, then copy or download the output.
Example
<?xml version="1.0"?><catalog><item id="1"><name>Example</name><price>12</price></item><note>Hello <b>world</b>!</note></catalog> Checks XML well-formedness, not XSD/schema validity. DTD/entity declarations are rejected. Mixed-content and xml:space="preserve" blocks stay unindented. Serialization may normalize spelling.
Questions & answers
Is this an XML schema validator?
No. It checks matching XML syntax, a single document element and well-formed attributes. It does not load XSDs or validate application-specific requirements.
Why are some blocks not indented?
Adding indentation can change mixed text content. Blocks with meaningful text alongside elements, CDATA, or xml:space="preserve" are retained without added indentation.
Does output preserve the original bytes?
No. Browser XML serialization can normalize entity spelling, empty-element syntax and namespace declarations. Preserve your original file for byte-sensitive or signed XML workflows.
Are external entities loaded?
DTD and entity declarations are rejected before parsing. No remote schema or document is fetched. Input is capped at 150,000 characters, 5,000 elements and depth 64.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
