XML Formatter
Check XML well-formedness independently or generate readable or compact output. Documents remain in this page without upload or persistent storage.
A QUICK WALKTHROUGH
How to use this tool
- Paste up to 200,000 characters of XML; DTD and entity declarations are not supported.
- Validate to see the root, element and attribute totals, and maximum depth, or choose pretty/compact output and two spaces, four spaces or tabs.
- Format or minify, review whitespace-sensitive text, then copy or download XML. Clear removes input, output and statistics.
Independent validation
Validation checks a single-root, well-formed XML document with the browser parser. It does not check XSD, DTD, business rules or external references. An element named parsererror is ordinary user content. Iterative traversal counts every element and attribute (including namespace declarations), with root depth 1.
Text-only local processing
DTD and entity declarations are rejected before parsing. XML is kept in detached parsing documents and text fields, never executed as HTML. No external resources are fetched, and no document is uploaded or persistently stored.
Formatting limits
The existing token formatter supports pretty and compact output with two spaces, four spaces or tabs. It may trim or change whitespace, including mixed content or xml:space-sensitive content; it is not lossless or canonical XML. Output is capped at 2,000,000 characters and reparsed before copy or download.
GOOD TO KNOW
Common questions
What does Validate do?
It checks well-formedness and shows the root name, all element and attribute totals, and maximum depth. The root counts as an element at depth 1; namespace declarations count as attributes. It does not generate formatted output or validate a schema.
Are DTDs or external entities supported?
No. DTD and entity declarations are rejected; external resources are not loaded.
Is formatting lossless?
No. Review whitespace-sensitive content before using the result. The source is kept until you edit or clear it.
What if copying fails?
The output is selected so you can copy it manually. You can also download the XML text file.