Skip to content

XML Formatter and Validator

Format, minify and validate XML, keeping comments, CDATA and attributes as written.

Paste XML on the left, or try a sample. It is checked as you type.

Input
Formatted

Your XML is checked in your browser and never sent to a server.

About this XML formatter

Format, minify and validate XML in your browser. Only the whitespace between tags changes: comments, CDATA sections, the XML declaration, the DOCTYPE and the order and quoting of attributes stay exactly as you wrote them. Mistakes such as a closing tag that does not match are shown with their line, and a click takes you there.

How to use it

  1. Paste XML, upload a file or try a sample.
  2. Choose Formatted for readable XML or Minified for the smallest size, and the indent.
  3. If the XML has a mistake, choose Go to error to jump to the line.
  4. Copy the result or download it as a file.

Frequently asked questions

Is my XML uploaded?

No. The XML is checked and formatted by your browser and never sent to a server.

Will formatting change my data?

Only the whitespace between tags changes. Text inside elements, attributes, comments and CDATA are kept as they are. Minify removes whitespace between tags but keeps spaces inside text.

What does the validator check?

That the XML is well-formed: every tag is closed in the right order, attributes are quoted and appear once, and there is a single root element. It does not check against an XSD or DTD schema.