Online XML validator

Validate your XML online and get detailed error messages

XML is valid!

What is XML?

XML stands for eXtensible Markup Language. It is a markup language and file format to store and transport data between disparate systems. It is designed to be both human-readable and machine-readable. It is very similar to HTML.

Several rules, defined by specifications, ensure that an XML document is well-formed and understandable by the recipient. It can be used to represent arbitrary data structures like lists or records.

XML syntax

XML is principally composed of a declaration, elements, attributes, and text or content.

  • Declaration: the first line of an XML document is the declaration. It defines the XML version and the encoding used. For example: <?xml version="1.0" encoding="UTF-8"?>. It is mandatory for XML version 1.1 but optional for XML version 1.0.
  • Elements: XML documents are composed of elements. An element is defined by a start tag, an end tag, and the content between them. For example: <element>content</element>
  • Attributes: elements can have attributes that are defined in the start tag. For example: <element attribute="value">content</element>
  • Text or content: the content of an element can be text or other elements. For example: <element>content</element> or <element><child>content</child></element>

Common errors

Here is a list of common errors you might encounter when writing XML:

  • Missing closing tag: elements must have an opening and a closing tag. For example: <element>content</element>
  • Missing closing bracket: each element must have an opening and a closing bracket. For example: <element>content</element>
  • Missing quotes: attributes value must be enclosed in quotes. For example: <element attribute="value">content</element>