Skip to main content
eyunzhu

XML formatter and validator

Validate and format XML locally with two- or four-space indentation, preserving mixed text and xml:space whitespace.

Indentation

Updates as you type or change an option


    
Processed in this browser. Nothing is uploaded or saved.

About this tool

Make element-based XML easier to read without adding whitespace inside meaningful mixed text. External entities and XSD validation are outside this tool’s scope.

How to use

Paste XML or open a UTF-8 file. Valid XML is formatted automatically; unmatched tags and other syntax problems are reported. Choose indentation, then copy or download the result.

Mixed-content elements and xml:space="preserve" subtrees retain their content. Only suitable element structures are indented. DOCTYPE and external entities are unsupported; this is not XSD validation. Input limit: 1 MiB and 80 nested levels.

Common questions

Why are some XML elements left on one line?

Adding indentation can change mixed text, CDATA or xml:space="preserve" content. Those subtrees retain their content. Valid syntax does not establish compliance with an XSD or business contract.

Why can a saved XML file fail to open here?

Imports must contain valid UTF-8, even if the XML declaration names another encoding. Convert the file encoding first. Processing is local, and downloaded XML declares UTF-8 when a declaration is present.

Can I format XML containing a DOCTYPE?

No. DOCTYPE is rejected and external entities are not loaded. Use an entity-resolved export from your source system; input must also fit within 1 MiB and 80 nested levels.

Comments

0
to join the discussion.
No comments yet.
Reply thread

Follow the complete conversation chronologically; each reply identifies the specific message it answers.