Code Beautifier

XML Validator

Check that XML is well-formed and get the error code, line, and column, plus document stats when it passes.

Draft saved locally.

Local workspace

Named projects in IndexedDB · Local only — never synced to our servers. Worksp

Open manager

Batch workspace

Format multiple files locally in one run.

xml
json

Options

OptionDescription
Allow attributes without valuesAccepts HTML-style attributes like <input disabled>. Strict XML requires every attribute to have a quoted value.

FAQ

What's the difference between well-formed and valid XML?

Well-formed XML follows the syntax rules: one root element, matched and properly nested tags, and quoted attributes. Valid XML also conforms to a DTD or XSD schema. This tool checks well-formedness and doesn't load schemas.

Why does the validator show only one error at a time?

XML parsers stop at the first well-formedness error, because everything after it is ambiguous. Fix the reported line and validate again.

What does InvalidTag mean?

A closing tag doesn't match the most recently opened tag, or a tag is never closed. The message names both tags and where the open one started.

How do I fix 'Attribute is repeated'?

The element declares the same attribute twice. Keep one of them; XML doesn't allow duplicates, even with identical values.

Does the XML declaration have to come first?

Yes. <?xml version="1.0"?> must be the very first characters of the document, with no blank lines or spaces before it.