99digest is in early access — tools are free while we grow.
Guide

How to Format and Validate XML

To format XML, paste it into the XML Formatter, which checks that it is well-formed and re-indents it so it is easy to read. If the XML has an error, the tool reports it instead of formatting.

Follow along with the free XML Formatter / Validator, which runs in your browser, or browse more tools in this category.

How to use the XML Formatter / Validator

  1. Paste your XML.
  2. Run the formatter.
  3. If it reports an error, fix the mismatched or unclosed tag and run it again.
  4. Copy the indented XML.

Worked example

<a><b>1</b><c>2</c></a> is re-indented so each element sits on its own line, making the nesting visible.

Tips and common mistakes

  • Every opening tag needs a matching closing tag and elements must nest properly.
  • Attribute values must be quoted.
  • Well-formed only means the syntax is right; it does not check against a schema.

Frequently asked questions

What does well-formed mean?

The XML follows the basic syntax rules: one root element, matched tags and quoted attributes.

Does it validate against an XSD schema?

No. It checks well-formedness, not a specific schema.

Is it private?

Yes. Formatting happens in your browser.

Try the XML Formatter / Validator Free, instant, and runs in your browser.