XML Formatter
Reindent XML documents for review while keeping text-bearing elements and xml:space="preserve" regions intact. Open a local XML file, choose indentation and download the formatted document without uploading it.
🔒 100% private — files never leave your browser
Result
How to use the XML Formatter
- 1 Paste an XML document or open a local file.
- 2 Select two spaces, four spaces or tabs and format. Fix any reported XML parsing errors.
- 3 Review the output and copy it or download a formatted XML file.
Frequently asked questions
Does formatting change text content?
Indentation is added only to element-only regions. Mixed text, CDATA and xml:space="preserve" subtrees are left unindented. Existing element-only indentation is replaced, so do not reformat cryptographically signed XML.
Does the tool support DTDs or external entities?
No. DOCTYPE declarations are rejected and no external resources are fetched. The tool parses XML structure but does not validate against a DTD or XSD.
Will the output match the original bytes?
No. DOM serialization may normalize attribute quoting, entity spelling and empty-element syntax. Comments and processing instructions are retained. Files are limited to 500 KB and processing runs locally with a timeout.