Format, minify and check XML while preserving text, comments and CDATA. Choose your indentation, then copy or download the result.
Attribute repairs
Open or drop XML, XSD or SVG (up to 8 MiB). UTF-8 or UTF-16 with BOM. Your file is read only in this browser.
Fix an error quickly. If validation finds a line and column, select Go to error location to jump to the affected text. Files are never uploaded by this formatter.
Keep your content intact. Formatting changes indentation between element-only tags. Mixed text, inline spaces, comments, CDATA and xml:space="preserve" regions are kept. Validate checks well-formed XML and leaves the original unchanged.
Fix attributes quotes simple unquoted attribute values, then validates and formats the XML. Missing tags and ambiguous values need a manual edit.
Processed in your browser. Supports XML 1.0 up to 2,097,152 characters, 100,000 nodes and 128 levels of nesting. External DTDs are not loaded; internal DTD subsets and custom entities are unsupported. This is a well-formedness check, not XSD or DTD validation.
Download as UTF-8. The file uses UTF-8; any existing encoding declaration is adjusted to match. Keep original preserves the declaration in the displayed and copied result.
Frequently Asked Questions
What does this XML formatter change?
Format XML adds consistent indentation between element-only tags. Minify removes that indentation. Both preserve text-sensitive content, comments, CDATA, attribute values and XML namespaces. Mixed content and xml:space="preserve" regions remain unchanged. Indentation-only whitespace can still matter to some applications; use xml:space="preserve" when it must be retained.
How is my XML processed?
XML parsing and formatting run in your browser. The tool does not submit your XML to a conversion server. The input, output and repair messages are marked for masking in the page’s session analytics.
What does Fix attributes repair?
Fix attributes adds quotes around simple unquoted attribute values and reports the repairs. The repaired document must pass validation before any output is offered. It does not invent missing tags or guess ambiguous values.
What does Validate check?
Validate checks XML 1.0 well-formedness, including matching tags, attribute syntax and namespace declarations, while leaving the original XML unchanged. It does not check an XSD schema or validate against a DTD. Simple and external DOCTYPE declarations are preserved, but external resources are never loaded. Internal DTD subsets and custom entities are not supported.
How do indentation, empty elements and declarations work?
Choose 2 spaces, 4 spaces or tabs. Self-close empty elements changes an empty tag pair to a self-closing tag where content is not protected. The declaration control can preserve the original, add a UTF-8 declaration or remove it. These options apply to Format XML, Minify and Fix attributes; Validate leaves the input unchanged.
Why does Download XML sometimes change the encoding declaration?
Downloads contain UTF-8 bytes. An existing encoding declaration such as UTF-16 is changed to UTF-8 in the downloaded file so parsers read those bytes correctly. With Keep original selected, the displayed and copied XML retain the source declaration.
What are the size limits?
The formatter accepts up to 2,097,152 input characters, 100,000 nodes and 128 levels of nesting, with an 8,388,608-character output limit. These limits help keep processing bounded. For a larger document, split it into complete XML documents or use a local XML editor.