XML Formatter and Minifier — Validate and Adjust Indentation

Developer Tools

Loading tool...

About This Tool

Validate XML and format element-only sections with spaces or tabs. Preserve mixed text, CDATA and xml:space content while reviewing output size.

How to Use

  1. Paste a well-formed XML document.
  2. Choose two spaces, four spaces or tabs.
  3. Beautify or Minify, then check the output or parsing error.
  4. Copy the result after reviewing whitespace-sensitive content.

Validate before formatting

The browser XML parser rejects malformed documents before output is generated. Beautify adjusts indentation in element-only sections; Minify removes indentation there. Mixed text, CDATA and xml:space="preserve" sections are kept intact. Documents with a DTD are returned unchanged after parsing.

Serialization is a change

The XML serializer may normalize quote style, entities or empty-element notation. Without a schema, whitespace between child elements cannot always be classified as insignificant. Keep the original when signatures, exact byte comparison or whitespace-sensitive consumers matter. This is not XSD validation or canonical XML.

Output information

Sizes use UTF-8 bytes; the tag counter is a simple estimate. Copy is disabled after parsing errors. Shared services are described in the privacy policy.

Frequently Asked Questions

Does it validate against an XSD?
No. It checks well-formed XML syntax, not schema conformance.
Will every byte be preserved?
No. Parsing and serialization can change quoting, entities and empty-element notation.