HTML Entities: Named, Decimal, and Hexadecimal Formats

Last updated: August 29, 2026.

An HTML character reference begins with an ampersand. Named references are memorable for common characters; numeric references identify a Unicode code point in decimal or hexadecimal.

Equivalent forms

Use references for syntax-sensitive characters, invisible characters, or symbols that are difficult to type.

CharacterNamedDecimalHex
&&&&
<&lt;&#60;&#x3C;
©&copy;&#169;&#xA9;

Use UTF-8 for ordinary text

Accented letters and non-Latin text can be written directly in a UTF-8 document. This is usually easier to read than encoding every character.

<p>Research &amp; development</p>
<p>Use &lt;code&gt; for inline code.</p>
<p>Copyright &copy; 2026</p>

Keep the semicolon

End references with a semicolon. Historical exceptions exist, but omission can make the boundary ambiguous when letters or digits follow. Numeric references do not change the document encoding.

Use character references for a reason

Write normal Unicode characters directly when that keeps the source readable. Use character references for reserved HTML syntax, invisible spacing characters, or symbols that are difficult to enter reliably in the authoring environment.

View the rendered text and inspect the DOM to confirm that the browser produced the intended character. Also test copied text, because a visually similar symbol may have a different code point and meaning.

  • Escape ampersands before building entities.
  • Do not encode every non-ASCII character.
  • Use semantic HTML instead of decorative symbols where possible.

Keep the byte encoding, declaration, storage, and decoder consistent. When diagnosing a problem, preserve the original input and change one boundary at a time so the actual cause remains visible.

Continue with special characters reference, Unicode code points, and character sets list.

Practical implementation check

Use browser developer tools and a command-line HTTP client to inspect the actual response rather than relying on appearance alone. Keep a small test page containing ASCII, accented text, punctuation, currency symbols, and emoji. That sample makes an incorrect declaration or conversion obvious and gives you a repeatable check after server, template, or import changes.

Reference: WHATWG named character references.

admin

admin