XML Formatter

Pretty-print and minify XML with syntax validation, indent control, and parse error line hints.

Files and content are processed locally in your browser and are not uploaded to our server.

About this tool

Format XML with consistent indentation or compress it into a single line. Syntax errors are shown so that missing closing tags and other invalid markup can be corrected.

How to use

  1. Format XML with adjustable indentation
  2. Compress XML into a single line
  3. Report syntax errors
  4. Preserve the order of attributes where possible
  5. Copy or download the result
  6. Paste XML: Input raw XML from logs, APIs, or legacy systems.
  7. Format or minify: Choose beautify or compact output.
  8. Validate: Run validate to catch syntax issues early.

Examples

Limitations

FAQ

Does it validate against XSD?
No. Only well-formed XML parsing is checked, not external schemas.
Will formatting change CDATA sections?
CDATA content is preserved; surrounding whitespace may normalize on minify.
Can I minify SVG?
Yes. Minify removes extra whitespace; test SVG rendering after compression.