XML Formatter, Minifier & Validator

Paste any XML document — an RSS or Atom feed, a sitemap.xml, a SOAP envelope, a Spring config, an OpenAPI document, a Web App Manifest — and get it back pretty-printed, minified, or validated for well-formedness. Errors are surfaced at the exact line and column of the bad byte. Everything runs in this tab; nothing is uploaded.

Mode
Options

Pretty-print

Minify

Element tree (read-only)

A condensed view of the parsed element tree with element names, attribute counts, and a one-line preview of each text child. Updates live as you type.

    How the formatter works
    • Pretty-print re-emits your XML with a chosen indent (2 spaces, 4 spaces, or a tab). Text-only children stay on the same line as their parent tag; block-level content gets its own line per element. Self-closing tags stay self-closing.
    • Minify drops every run of whitespace between tags and (by default) collapses internal whitespace inside text to a single space. Use Preserve text content when you want the bytes inside elements (the actual data) untouched, but the markup around them compacted.
    • Validate only clears the output box and just reports whether the document is well-formed. Useful as a CI-style quick check.
    • Errors are reported with the exact line and column of the offending byte: unclosed tags, unterminated comments, bad entity references, missing quotes, mismatched end tags, top-level text, duplicate root elements, and so on.
    • The formatter handles XML declarations (<?xml … ?>), DOCTYPE declarations, comments, CDATA sections, and processing instructions like <?xml-stylesheet … ?>. The five predefined entities (&lt; &gt; &amp; &apos; &quot;) and decimal / hex character references are decoded on read and preserved verbatim on write.
    • Nothing leaves the browser. The whole tool runs on a 20 KB script and your document never touches the network.