Skip to main content
WHATWG HTML Living Standard §13.5 2,125 Canonical Named References Decimal & Hex Numeric Codes

HTML Entities & Character References

HTML character references (commonly called HTML entities) represent characters in HTML markup using predefined mnemonic names or numeric Unicode code points. Named references exist for a finite, authoritative set of 2,125 canonical characters defined by the WHATWG HTML Living Standard, while numeric decimal (&#[dec];) and hexadecimal (&#x[hex];) references can represent any valid Unicode scalar value. Use character references to safely escape syntax-sensitive delimiters (&, <, >, ", ') or specify characters when source encoding is constrained.

2,125 Canonical Named References
106 Legacy Parser Aliases
93 Multi-Codepoint Sequences
1,112,064 Unicode Scalars (Numeric)

Common HTML Entities & Developer Quick Reference

The most frequently used HTML character references for web development, typography, mathematical formulas, and currency symbols. Click any code format to instantly copy it to your clipboard.

&
Ampersand (HTML syntax delimiter)
Named
Dec
Hex
<
Less-Than Sign (Tag open)
Named
Dec
Hex
>
Greater-Than Sign (Tag close)
Named
Dec
Hex
"
Quotation Mark (Double quote)
Named
Dec
Hex
'
Apostrophe (Single quote)
Named
Dec
Hex
 
No-Break Space (U+00A0)
Named
Dec
Hex
©
Copyright Symbol
Named
Dec
Hex
®
Registered Sign
Named
Dec
Hex
Trade Mark Sign
Named
Dec
Hex
Euro Currency Sign
Named
Dec
Hex
£
Pound Currency Sign
Named
Dec
Hex
¥
Yen Currency Sign
Named
Dec
Hex
°
Degree Symbol
Named
Dec
Hex
±
Plus-Minus Sign
Named
Dec
Hex
×
Multiplication Sign
Named
Dec
Hex
÷
Division Sign
Named
Dec
Hex
Infinity Symbol
Named
Dec
Hex
Rightwards Arrow
Named
Dec
Hex
Black Heart Suit
Named
Dec
Hex
Em Dash
Named
Dec
Hex

Syntax-Sensitive Characters & Context-Aware Escaping

HTML defines five reserved delimiter characters that trigger parser state changes: & (entity introducer), < (tag opener), > (tag closer), " (attribute delimiter), and ' (attribute delimiter). Escaping these characters is essential to prevent parsing ambiguity and Cross-Site Scripting (XSS) vulnerabilities. Whether escaping is mandatory depends strictly on the parsing context.

Char Named Entity Decimal Hex Unicode Why Escaped & Parsing Risk
U+0026
U+003C
U+003E
U+0022
U+0027

Context-Dependent Escaping Requirements

The HTML specification establishes different escaping constraints depending on where the character appears in the document object model:

<p>Body Text</p>

HTML Text Content

Inside standard HTML element body text (e.g. paragraphs, spans, headings):

  • & → Must be escaped as &amp; to prevent unintended entity parsing.
  • < → Must be escaped as &lt; to prevent interpreting subsequent text as a new tag name.
  • > → Recommended as &gt;, though technically allowed unless preceded by two hyphens or closing markup.
  • " and ' → Safe without escaping in body text.
attr="value"

Double-Quoted Attributes

Inside double-quoted attribute values (e.g. title="...", href="..."):

  • " → Must be escaped as &quot; (prematurely terminates attribute value if unescaped).
  • & → Must be escaped as &amp; when followed by a name character or hash.
  • < and > → Safe inside quotes, but escaping is recommended for consistency.
  • ' → Safe without escaping inside double quotes.
attr='value'

Single-Quoted Attributes

Inside single-quoted attribute values (e.g. title='...'):

  • ' → Must be escaped as &apos; or &#39; (prematurely terminates attribute value if unescaped).
  • & → Must be escaped as &amp;.
  • " → Safe without escaping inside single quotes.
  • < and > → Safe inside quotes, recommended to escape.
attr=value

Unquoted Attributes (Dangerous)

In unquoted attributes (e.g. class=main):

  • Spaces, tabs, newlines → Strictly prohibited (breaks tokenization).
  • " ' = < > ` & → Must all be strictly escaped or avoided.
  • Best Practice: Always quote all HTML attribute values with double quotes. Never use unquoted attributes for dynamic content.

HTML Character References Directory

Authoritative, standards-compliant directory of all 2,125 canonical WHATWG named character references alongside their exact decimal (&#[dec];) and hexadecimal (&#x[hex];) numeric representations. Click any value to copy to clipboard.

Char Named Reference Decimal Code Hexadecimal Code Code Point Category Copy
Æ Symbols
& Common
Á Symbols
Ă Symbols
 Symbols
А Symbols
𝔄 Symbols
À Symbols
Α Greek
Ā Symbols
Math
Ą Symbols
𝔸 Symbols
Symbols
Å Symbols
𝒜 Symbols
Math
à Symbols
Ä Symbols
Math
Math
Symbols
Б Symbols
Math
Symbols
Β Greek
𝔅 Symbols
𝔹 Symbols
˘ Symbols
Symbols
Math
Ч Symbols
© Common
Ć Symbols
Math
Symbols
Symbols
Č Symbols
Ç Symbols
Ĉ Symbols
Math
Ċ Symbols
¸ Symbols
· Symbols
Symbols
Χ Greek
Math
Math
Math
Math
Page 1 of 43

Named References vs Numeric Codes (Decimal & Hex)

HTML provides three distinct syntaxes for referencing characters: mnemonic Named References, base-10 Decimal References, and base-16 Hexadecimal References. Understanding the capabilities and boundaries of each format is critical for modern web engineering.

Char Character Name Named Reference Decimal Reference Hexadecimal Reference Code Point
Copyright Sign
Ampersand
Euro Sign
Grinning Face (No named entity) None (Numeric only)
&name;

Named Character References

Syntax: &[name]; (e.g. &copy;, &amp;)

  • Finite Vocabulary: Exactly 2,125 canonical names exist in the WHATWG specification. No other named entities are valid.
  • Strict Case Sensitivity: Character names are case-sensitive. &Epsilon; (Ε) produces Greek capital letter Epsilon (U+0395), whereas &epsilon; (ε) produces Greek small letter epsilon (U+03B5).
  • Readability: Highly mnemonic and easy for humans to read and audit in source templates.
  • Emoji Limitation: Modern emojis (such as 😀 U+1F600 or ❤️ U+2764) have zero named references. Trying to write &grinning; or &heart; will render verbatim as broken text.
&#dec;

Decimal Numeric References

Syntax: &#[decimal]; (e.g. &#169;, &#8364;)

  • Full Unicode Coverage: Can represent any of the 1,112,064 Unicode scalar values (U+0000 to U+10FFFF, excluding surrogates U+D800..U+DFFF).
  • Universal Parser Support: Supported by 100% of HTML, XML, SVG, and SGML parsers without requiring external entity catalogs or DTDs.
  • Base-10 Conversion: Requires converting hexadecimal Unicode codepoints to decimal (e.g. U+20AC → 8364).
  • Legacy Windows-1252 Pitfall: In older SGML/HTML 4 documents, numbers 128–159 were often used for Windows-1252 characters (e.g. &#128; for €). Modern HTML5 parsers automatically re-map these control points, but standard authors should use the true Unicode codepoints (e.g. &#8364;).
&#xhex;

Hexadecimal Numeric References

Syntax: &#x[hex]; or &#X[hex]; (e.g. &#xA9;, &#x20AC;)

  • Direct Unicode Alignment: Directly maps to Unicode code points without mathematical conversion (e.g. U+20AC → &#x20AC;).
  • Preferred for Developer Tooling: Because Unicode specifications, font tables, and IDEs reference characters by hex (U+XXXX), hexadecimal references reduce cognitive load and conversion bugs.
  • Case Insensitive 'x' and Digits: The leading indicator can be x or X, and hex digits a-f or A-F are parsed equivalently by compliant user agents.
  • Leading Zeros Optional: &#x41;, &#x0041;, and &#x000041; all evaluate to 'A' (U+0041).

Multi-Codepoint Entity Sequences (The 93 Compound References)

A common misconception among software engineers is that every HTML named reference maps to exactly one Unicode code point. In reality, the WHATWG HTML Living Standard defines exactly 93 named character references that expand into sequences of two distinct Unicode code points.

Advanced Parser Architecture

How HTML Parsers Process Compound Sequences

When an HTML5-compliant tokenizer encounters a named entity like &NotEqualTilde;, the named character reference state matches the full string and emits two distinct Unicode scalar values: U+2242 (Asymptotically Equal To) immediately followed by U+0338 (Combining Long Solidus Overlay).

Char Named Reference Unicode Codepoint Sequence Compound Decimal Code Compound Hexadecimal Code
≂̸ &NotEqualTilde; U+2242 U+0338 &#8770;&#824; &#x2242;&#x338;
=⃥ &bne; U+003D U+20E5 &#61;&#8421; &#x3D;&#x20E5;
∩︀ &caps; U+2229 U+FE00 &#8745;&#65024; &#x2229;&#xFE00;
≡⃥ &gne; U+2265 U+0338 &#8805;&#824; &#x2265;&#x338;
≤⃥ &lne; U+2264 U+0338 &#8804;&#824; &#x2264;&#x338;

Critical Engineering Implications:

1. No Single Numeric Equivalent Exists

An HTML numeric entity syntax (&#[dec];) accepts only a single integer scalar value. To represent a multi-codepoint named entity numerically, you must concatenate two adjacent numeric references (e.g. &#8770;&#824;).

2. UTF-16 String Length Miscalculations

In JavaScript, C#, and Java, compound sequences may comprise 2 or 3 16-bit code units (especially if combining with surrogate pairs). Always use Array.from(str) or Unicode-aware iterators rather than str.length to measure character counts.

3. Combining Mark Normalization

Most compound references pair a base mathematical operator or symbol with a combining diacritical mark (such as U+0338 Combining Long Solidus Overlay). Modern font rendering engines (HarfBuzz, DirectWrite, CoreText) shape them into a single visual glyph.

Best Practices: Direct UTF-8 Authoring vs Character Escaping

In modern web engineering, when should you write raw Unicode characters directly, and when must you use HTML character references? Following standards-based guidelines prevents source code bloat, improves maintainability, and eliminates security vulnerabilities.

!

When Character References ARE Mandatory

Character references are strictly necessary in four specific scenarios:

  1. Syntax Delimiters: Raw &, <, and > in text content, or quotes (", ') inside matching attribute values.
  2. Invisible / Non-Printing Characters: Non-breaking space (&nbsp;), zero-width non-joiner (&zwnj;), and zero-width joiner (&zwj;). Writing these raw can lead to accidental deletion or re-formatting by IDE linters, minifiers, and code formatters.
  3. Ambiguous Glyphs: Characters that are visually indistinguishable from ASCII characters (e.g. Greek question mark &quest; / ; vs semicolon ;, or Cyrillic small letter 'a' vs Latin 'a').
  4. ASCII-Restricted Environments: Legacy 7-bit SMTP email transport, legacy SGML tools, or systems unable to process multi-byte UTF-8 streams.

The Semicolonless Entity Trap & URL Corruption

WHATWG Historical Quirk

The WHATWG HTML Living Standard documents 106 legacy named entities that historically allowed omitting the trailing semicolon (e.g. &amp, &copy, &gt, &lt, &quot, &reg). This exists solely for backwards compatibility with broken 1990s web pages.

Broken URL Query Parameter: <a href="search.php?category=books&copy=true">View Books</a>
How Browsers Parse It: search.php?category=books©=true ← Parameter key corrupted to copyright glyph!
Correct Standard Authoring: <a href="search.php?category=books&amp;copy=true">View Books</a>
Interactive Web Tool

Batch HTML Entity Encoder & Decoder

Need to encode entire documents, sanitize user inputs, or decode obfuscated HTML entities back to raw UTF-8 text? Use CopyCharacter's free online HTML Entity Encoder. Convert instantly with options for named entities, decimal codes (&#[dec];), or hexadecimal codes (&#x[hex];).

✓ 100% Client-Side Privacy ✓ WHATWG Living Standard Compliant ✓ Bi-directional Batch Conversion

Standards Compliance & Dataset Provenance

Every character reference, codepoint mapping, and parser behavior documented on this page is directly derived from the official specifications maintained by the Web Hypertext Application Technology Working Group (WHATWG), the World Wide Web Consortium (W3C), and the Unicode Consortium.

Authoritative Source WHATWG HTML Living Standard §13.5
Data Snapshot Endpoint html.spec.whatwg.org/entities.json
Total Registered Keys 2,231 entries
Canonical Authoring Forms 2,125 semicolon-terminated references
Legacy Compatibility Aliases 106 semicolonless historical entries
Multi-Codepoint Sequences 93 compound references
Dataset Verification SHA-256 00289ceb64acb3071f854c90e80c72f519bb2c3af5e8801f2e60468637cd911f

Normative Citations: