DO IT EASY APP
English

XML validator and formatter

Check that your XML is well-formed, see the line of any error, and get it pretty-printed or minified.

  • No sign-up, no fees.
  • Checks whether XML is well-formed.
  • Tells you the line and column of the error.
  • Pretty-prints with indentation or minifies to one line.
  • What you type is processed, but never shared with anyone.

XML formatter: how to use the XML validator

An XML file says "invalid" but where? Three steps:

  1. Paste the XML. Put the content into the XML text box.
  2. Read the result. If it's valid, it says how many elements it found; if not, you get the line, column and reason of the error.
  3. Format or minify. Format gives the indented, readable version and Minify the single-line one. You can pick 2 spaces, 4 spaces or a tab for the indent.

What is XML and what does "well-formed" mean?

XML is a text format that writes data with tags (<name>Ann</name>). Configuration files, sitemaps, RSS feeds, SVG images and many business data exchanges use XML. For XML to be well-formed it needs a single root element, every opened tag has to be closed in the right order, attribute values must be quoted, the same attribute can't appear twice on one tag, and a literal & in text has to be written as &amp;.

What you need to know

  • This tool checks syntax. It doesn't check conformity to a schema (XSD).
  • Comments, CDATA sections, the <?xml ?> declaration and DOCTYPE are accepted.
  • Minifying removes comments; formatting keeps them.
  • Tag names are case sensitive: <A> and <a> are different.

Tips

  • The most common slip is the & sign: write "Tom & Jerry" instead of "Tom & Jerry".
  • If you need JSON from XML, validate here first and convert after. For the JSON side there's the JSON formatter.
  • For HTML special characters, the HTML entity encoder helps.

Frequently asked questions

Is XML validation free?

Yes, it's free with no sign-up.

Does it validate against an XSD schema?

No, it only checks whether the XML is well-formed.

Is my XML sent anywhere?

What you type is processed, but never shared with anyone. It all happens in your browser.

The error line seems off. Why?

The error usually points to where the problem was noticed. A tag that never closes can be noticed at the end of the file or at the next tag.

Does formatting change the text?

Whitespace is tidied; the content and order of the elements don't change.

Does it work with large XML files?

Files of a few hundred KB are fine.

Related tools