← All tools Make XML structure easier to inspect

XML Formatter & Validator

Format or minify XML, validate elements and attributes, and copy or download the result.

Format or minify Find structural errors Reject DOCTYPE declarations

XML input

Paste XML or drop a UTF-8 .xml file.

XML result

Valid formatted or minified XML appears here.

Document Tools guide

How to use XML Formatter

Make compact XML easier to inspect or remove presentation whitespace when a smaller source representation is needed.

Three simple steps

  1. Paste XML or load a UTF-8 .xml file.
  2. Choose indentation and format the document, or select minify.
  3. Review the validated result, then copy or download the XML.

XML handling

  • Element nesting, names, attributes, entities, comments, CDATA sections, and processing instructions are checked.
  • Text-only elements remain inline so their text content is not changed by formatting.
  • DOCTYPE declarations are rejected and external entities are never resolved.

Frequently asked questions

Does formatting change XML text values?

Text-only elements remain inline, while indentation-only whitespace between child elements is normalized.

Why are DOCTYPE declarations rejected?

Rejecting DOCTYPE avoids external-entity and document-type processing in this focused formatter.

Can I minify XML?

Yes. Minify removes presentation whitespace between structural nodes while preserving meaningful text and markup.