Skip to content
MixTool

XML formatter

Turn cramped XML into neatly indented markup, confirm it's well-formed, or minify it for production.

  • Runs entirely in your browser
  • Free · no sign-up
  • Works on phone and desktop
Loading tool…

Clean, well-formed XML

Paste XML — a sitemap, an RSS feed, a SOAP response, an Android layout or a config file — and the formatter re-indents every element so the hierarchy is obvious at a glance. The XML declaration, doctype, comments and CDATA sections are preserved exactly.

The formatter parses your input with the browser's strict XML parser, so it also works as a well-formedness checker: unclosed tags, mismatched names, bad characters and unescaped ampersands are reported with a line number. When you're done, minify the XML to strip indentation for the smallest possible file.

How to format XML

  1. 1

    Paste your XML

    Or open an .xml file.

  2. 2

    Choose indentation or minify

    2 spaces, 4 spaces, tabs or a single line.

  3. 3

    Fix any errors

    The error message shows the line to look at.

  4. 4

    Copy or download

    Save the formatted file.

Key features

  • Strict parsing

    Catches mismatched and unclosed tags.

  • Keeps everything

    Declaration, doctype, comments and CDATA are preserved.

  • Minify option

    Removes whitespace between tags.

  • Private

    Your XML stays in your browser.

Common uses

  • Sitemaps and feeds: Inspect sitemap.xml or an RSS feed before submitting it.
  • SOAP and legacy APIs: Read verbose XML responses comfortably.
  • Office and app files: Tidy XML extracted from DOCX, Android or Maven projects.

Tips and good to know

Frequently asked questions

What does “well-formed” mean?

Every tag is closed, tags nest properly, there's exactly one root element, attribute values are quoted and special characters are escaped.

Does formatting change my data?

Only whitespace between elements changes. Text content, attributes and comments stay the same.

Can it validate against an XSD schema?

No. It checks well-formedness, which catches most errors. Schema validation needs the XSD file and a dedicated validator.