XML Validator

Check that XML is well formed, see its root element and size, and format it with indentation.

Runs in your browser — nothing is uploaded

About the XML Validator

XML must be well formed before any other processing: every tag closed, attributes quoted, and a single root element. A single missing closing tag can make a whole configuration file unreadable, so a quick check saves time.

Paste your XML. The validator reports whether it is well formed, names the root element and counts elements, and shows an indented version you can copy. Errors come from the browser's own XML parser, so the message points to the problem.

FAQ

XML Validator — frequently asked

Does well-formed mean valid?

No. Well formed means the syntax is correct. Valid means it also follows a schema or DTD, such as XSD. This tool checks syntax only.

What is the most common XML error?

Mismatched or unclosed tags, unescaped ampersands such as & instead of &, and attribute values without quotes. The error message names the position of the first problem.

Why does my XML have a declaration problem?

The declaration must be the very first thing in the file, with no blank line or byte-order problem before it. Save the file as UTF-8 without a leading space.

Can XML have more than one root element?

No. Every XML document has exactly one root element. Wrap multiple items in a single parent tag.

Does formatting change the meaning?

The indentation adds whitespace between tags, which is generally ignored, but whitespace inside text nodes is preserved. Do not format XML where whitespace in text matters, such as in some mixed-content documents.

Is my XML uploaded?

No. Parsing and formatting run in your browser, so configuration files and private data stay on your device.

    Report an issue