HTML Guides for ampersand
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
A numeric character reference starts with &# but has no digits after it, so the parser can't turn it into a character.
Numeric character references come in two forms: &# followed by a decimal number, such as ©, or &#x followed by a hexadecimal number, such as ©. Both end with a semicolon. When the parser reads &# or &#x and the next character isn't a digit, it reports this error and keeps those characters as plain text, so &#; shows up on the page exactly as typed.
The quoted part of the message is the text that comes before &# in the same attribute value. For a reference in text content there is no preceding text, so the quotes are empty. Two common causes are a template that builds a reference from an empty variable, such as an icon font code point, and a literal &# in text or in a URL that was never escaped.
To fix it, put the code point of the character you want between &# and the semicolon, or use a named reference like ©. If you meant to show the characters &# on the page, escape the ampersand as &#.
Invalid example
<p><span class="icon" aria-hidden="true">&#x;</span> Cart</p>
<p>Type &# and a number to insert a character by its code point.</p>
Valid example
<p><span class="icon" aria-hidden="true">🛒</span> Cart</p>
<p>Type &# and a number to insert a character by its code point.</p>
An unescaped & in an attribute value is followed by the name of a character reference, so the parser turned that text into a different character.
HTML treats & as the start of a character reference such as &, © or ®. A few older names, including copy, reg, para and not, still work without the trailing semicolon. Inside an attribute value, the parser converts one of them when the next character isn't =, a letter or a digit, or when the value ends right after the name. So title="© 2025 Example News" becomes "© 2025 Example News", and href="/news?id=10¶" ends in ¶ instead of ¶, which sends the link somewhere else.
When the name is followed by =, a letter or a digit, as in ?id=10®=europe, the parser leaves the text alone so that old URLs keep working, and the validator doesn't report it. In regular text outside attributes, a reference without its semicolon gets a different message: Named character reference was not terminated by a semicolon.
Escape every literal & as &. If you meant the symbol, end the reference with a semicolon.
Invalid example
<!-- ¶ becomes ¶ and © becomes © -->
<a href="/news?id=10¶" title="© 2025 Example News">Read the report</a>
Valid example
<a href="/news?id=10&para" title="© 2025 Example News">Read the report</a>
Browsers convert & back to a single & before requesting the URL, so the link works exactly as written while the markup stays valid.
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries