Description of Errors

HTML5 Parse Errors in Tokenization Stage

Tag <$0> is not allowed after the end tag </html>.

The start or end tag of an element appears after the html element has been closed. The document is non-conforming.

Any content of the document other than comments must be put into the html element.

Tag <$0> is not allowed after the end tag </body>.

The start or end tag of an element appears after the body element has been closed. The document is non-conforming.

Any content of the document other than head contents and comments must be put into the body element.

The & character must introduce a reference.

An & (U+0026 AMPERSAND) character which is not part of any reference appears in the input stream. The document is non-conforming.

Any & character in URI (or IRI) must be escaped as &amp;.

The & character must be the first character of a reference:

Named entity reference
&entity-name;
where entity-name is the name of the character entity to be referenced.
Numeric character reference
&#d;
where d is the decimal representation of the code position of the character to be referenced.
Hexadecimal character reference
&#xh;
where h is the hexadecimal representation of the code position of the character to be referenced.

To represent & as a data character, use named entity reference:

&amp;

A </ string is not followed by a tag name.

There is a < (U+003C LESS-THAN SIGN) character immediately followed by a / (U+005F SOLIDUS) character, which is not part of any end tag, in the input stream. The document is non-conforming.

The </ sequence immediately followed by an EOF is interpreted as a string data of </.

The </ sequence as string data must be escaped as:

&lt;/

A < character is not followed by tag name or by a ! character.

A < (U+003C LESS-THAN SIGN) character which is not part of any markup appears in the input stream.

The < character as a data character must be escaped as:

&lt;

The decimal representation of the code position of a character must be specified after &#.

An & (U+0026 AMPERSAND) character immediately followed by a # (U+0023 NUMBER SIGN) character which is not part of any reference appears in the input stream. The document is non-conforming.

The string &# must be the first two characters of a reference:

Numeric character reference
&#d;
where d is the decimal representation of the code point of the character to be referenced.
Hexadecimal character reference
&#xh;
where h is the hexadecimal representation of the code point of the character to be referenced.

To represent &# as data characters, use a named entity reference for the & character:

&amp;#

The hexadecimal representation of the code position of a character must be specified after &#x.

The string &#x or &#X which is not part of any reference appears in the input stream. The document is non-conforming.

The string &#x or &#X must be the first three characters of a hexadecimal reference:

&#xh;
where h is the hexadecimal representation of the code point of the character to be referenced.

To represent &#x as data characters, use a named entity reference for the & character:

&amp;#x

String <! is not followed by --.

There is a < (U+003C LESS-THAN SIGN) character followed by a ! (U+0021 EXCLAMATION MARK) character, which is not followed by a -- or !DOCTYPE. The document is non-conforming.

Comments
In HTML documents, comments must be introduced by <!-- (<! immediately followed by two -s) and must be terminated by -->. Strings <! not followed by -- and <!- not followed by - are not valid open delimiters for comments.
Marked sections, including CDATA sections
Marked sections are not allowed in HTML documents.
Markup declarations
Markup declarations, except DOCTYPE and comment declarations, are not allowed in HTML documents.
String <!
String <! must be escaped as &lt;!.

String </ is not followed by tag name.

There is a < (U+003C LESS-THAN SIGN) character immediately followed by a / (U+005F SOLIDUS) character, which is not part of any end tag, in the input stream. The document is non-conforming.

The </ sequence not followed by a tag name is parsed as an opening of bogus comment.

The </ sequence as string data must be escaped as:

&lt;/

There is a -- sequence in a comment.

There is a - (U+002D HYPHEN-MINUS) character at the end of the comment or a -- sequence in the comment. The document is non-conforming.

Comments cannot contain a string --, as in XML. Unlike SGML, there cannot be more than one comments (where comment is an SGML term) in the comment declaration.

There are two attributes with name $0.

There are more than one attributes with the same name in a tag. The document is non-conforming.

The motion attribute is not part of the HTML standard. Use img element with animation GIF instead.

Void element syntax (/>) cannot be used for this element.

Void element syntax (/>) must not be used for the element. The document is non-conforming.

The void element syntax can only be used for base, link, meta, hr, br, img, embed, param, area, col, and input elements.

<script/>

The void element syntax cannot be used for script element. Even for an empty script element, there must be an explicit end tag </script>.

NOTE: Though some user agents interpret void element syntax for script element as the closing of the element, such usage is not allowed under the current standard.

<basefont/>, <bgsound/>, <frame/>, <keygen/>, <spacer/>, <wbr/>
These elements are themselves non-conforming.
<command/>, <event-source/>, <source/>
Future revision of HTML5 parsing algorithm is expected to allow void element syntax for these elements.
<a/>, <p/>
These elements are not always empty and therefore void element syntax is not allowed.

Note that, unlike in XML, the void element syntax has no effect in HTML.

Processing instruction (<?...>) cannot be used.

Processing instructions (<?...?>), including XML declaration (<?xml ...?>) and XML style sheet PI (<?xml-stylesheet ...?>), are not allowed in the HTML syntax. The document is non-conforming.

<?xml?> (XML declaration)
XML declaration is unnecessary for HTML documents.
<?xml-stylesheet?> (XML style sheet PI
Use HTML link element with rel attribute set to stylesheet (or, alternate stylesheet for an alternate style sheet).
<?php?> (PHP code)
The conformance checker does not support checking for PHP source documents.
Other processing instructions
Processing instructions cannot be inserted in an HTML document. Use XML document or insert ProcessingInstruction node by scripting.

Web browsers will parse processing instructions as bogus comments. Some legacy Web browsers, such as IE:mac and some mobile Web browsers, will display processing instructions as string.

HTML5 Parse Errors in Tree Construction Stage

The $0 element cannot be inserted between head and body elements.

A start tag appears after the head element is closed but before the body element is opened. The document is non-conforming.

A DOCTYPE appears after any element or data character has been seen.

A DOCTYPE appears after any element or data character has been seen. The document is non-conforming.

The DOCTYPE must be placed before any tag, reference, or data character. Only white space characters and comments can be inserted before the DOCTYPE.

Anchor cannot be nested.

HTML a elements cannot be nested. The document is non-conforming.

In the HTML syntax, a start tag of the a implies the end tag of any opening a element.

Tag <$0> is not allowed in the body element.

The start or end tag of an element, which cannot be a descendant of body element, appears in the input stream while the body element has been opened. The document is non-conforming.

Start tag <head> is not allowed in the head element.

There is a start tag <head> in the <head> element. The document is non-conforming.

In an HTML document there must not be more than one head element, therefore no more than one start tag <head> can appear in the input stream.

Tag <$0> is not allowed in a table element.

The start or end tag of an element, which cannot be a child of table element, appears in the input stream while the table element has been opened but no other element has been opened. The document is non-conforming.

In table, only table related elements are allowed; any other element must be contained in td or th element to form a part of the table, or caption element to create a table caption.

Data character is not allowed in table.

A data character appears in table. The document is non-conforming.

In table, only table related elements are allowed; any other element and data character must be contained in td or th element to form a part of the table, or caption element to create a table caption.

Start ta