XML formatter and validator

Check XML well-formedness with line numbers, and reformat with 2- or 4-space indentation or minify.

XML stays in this browser. Up to 200,000 characters. Elements that contain text keep their content on one line so the meaning never changes; indentation is applied only between elements. Entity references are kept as written.

How to use

  1. Paste XML.
  2. Choose an indentation or minify.
  3. Format, then copy or download the result.

What it supports

Validates element nesting, attributes, entities, comments, CDATA, and the single-root rule — it does not validate against DTDs or schemas. Elements containing text are never re-indented, so meaning is preserved. Entity references are kept as written. Up to 200,000 characters.

Related tools