XML Formatter and Adjuster

Paste your XML below to format, minify or check the syntax (well-formedness).

What is XML and what is this tool for?

XML (eXtensible Markup Language) is a markup format used to structure data hierarchically and readably — present in configuration files, feeds (RSS/Atom), Office documents, SOAP, sitemaps and legacy integrations between systems. Unlike JSON, XML describes structure through tags and attributes, and allows text content to be mixed with elements.

This tool processes the XML entirely in your browser, with its own parser (it doesn't use the browser's DOMParser), offering three main operations:

Elements with mixed content (text and tags in the same element, such as <p>Hello <b>world</b>!</p>) are not reindented internally — adding line breaks in that case would change the original text, so the tool preserves that piece exactly as it is.

Frequently Asked Questions (FAQ)

Does the tool validate against an XSD or DTD?

No. This tool only checks whether the document is well-formed — tags correctly opened/closed, valid attributes, a single root element, etc. It doesn't validate the semantic structure against an XSD or DTD schema (that would require loading and interpreting a separate schema file, outside the scope of this tool).

Does the tool expand entities declared in a DOCTYPE?

No. If the document has a <!DOCTYPE ...> declaration — including one with an internal subset defining custom entities — it's preserved as opaque text between the XML declaration and the root element, but it is not processed. Expanding DOCTYPE entities is a classic attack surface (XXE) and was deliberately left out of scope for this tool.

Which entities are supported in the text?

The five basic XML entities (&lt;, &gt;, &amp;, &quot;, &apos;) and numeric entities (&#65; or &#x41;). Any other named entity (which would require a DOCTYPE to be resolved) is reported as an error.

What does a "well-formedness" error mean?

It indicates that the text doesn't follow the structural rules of XML — for example, an opening tag without its matching closing tag, more than one root element in the document, an unquoted attribute, or unclosed attribute quotes.