Skip to content
M2TOOLKIT

Developer · free tool

XML Formatter & Validator

Indent XML so it's readable, or minify it — and check that it's well-formed.

Use it as often as you like — it's free, with no sign-up and no limits.

  • Developer
  • Free
  • No sign-up
  • Runs in your browser
  • Updated
Output

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us.

How to use the XML Formatter

  1. Paste your XML into the left box, or open a file.
  2. Adjust the options if you need to.
  3. Copy the formatted XML or download it as a file.

What does this tool do?

Your browser's XML parser checks that the document is well-formed (every tag closed, attributes quoted, one root element). Comments, CDATA sections and processing instructions are preserved.

Why use it?

  • Read sitemaps, feeds and SVG files.
  • Spot unclosed tags.
  • Minify XML for transport.

Well-formed vs valid

“Well-formed” means the XML follows syntax rules. “Valid” additionally means it matches a schema (XSD or DTD). This tool checks well-formedness.

Privacy

Everything you type is processed in your browser. Nothing you enter is sent to our servers or stored by us. There's no account to create and nothing to install.

Frequently asked questions

Can formatting change what my XML means?

Usually not, but in documents that mix text and tags (like XHTML or DocBook), added whitespace can show up in the text. For data files — feeds, configs, API payloads — formatting is safe.

How do I find what's wrong with invalid XML?

The formatter shows the parser's error. The most common causes are an unclosed tag, an unescaped & character, unquoted attribute values, or more than one root element.

Last reviewed by the M2Toolkit team.

Other tools people use alongside the xml formatter.