HTML Entities Cheat Sheet: Complete Reference Guide
A practical, category-organized reference for HTML character entities: what they are, when to use them, and every entity you will commonly need.
What Are HTML Entities?
HTML entities are special text sequences that represent characters in HTML documents. They begin with an ampersand (&) and end with a semicolon (;). Entities exist because certain characters have special meaning in HTML syntax -- the less-than sign (<) opens a tag, the ampersand starts an entity reference, and the greater-than sign (>) closes a tag. Without entities, there would be no way to display these characters as literal text in an HTML document.
Beyond the syntactically reserved characters, entities also provide access to characters that may not be easily typed on a standard keyboard: mathematical symbols, currency signs, Greek letters, arrows, and thousands of other special characters from the Unicode standard.
Three Forms of HTML Entity References
Every HTML entity can be expressed in three different forms. Understanding the differences helps you choose the right approach for your situation.
Named Entity References
Named entities use a human-readable keyword between the ampersand and semicolon. For example,© renders as the copyright symbol (©), and— renders as an em dash (—). Named entities are easier to read and remember, making your source code more maintainable. However, not every Unicode character has a named entity -- only about 2,200 named entities are defined in the HTML specification, out of over 140,000 Unicode characters.
Decimal Numeric References
Decimal numeric references use the pattern &# followed by the Unicode code point in decimal and a semicolon. For example,© also renders as the copyright symbol (©). Decimal references work for any Unicode character, making them the universal fallback when a named entity does not exist. They are commonly used for emoji and CJK characters.
Hexadecimal Numeric References
Hexadecimal numeric references use &#x followed by the Unicode code point in hexadecimal. For example, ©is another way to write the copyright symbol (©). Hexadecimal references are useful when working with Unicode charts and documentation, which typically list code points in hex.
Entity Reference Formats Compared
| Character | Named | Decimal | Hex |
|---|---|---|---|
| © | © | © | © |
| & | & | & | & |
| < | < | < | < |
| € | € | € | € |
Essential HTML Entities (Must Know)
The following five entities are the ones every web developer must memorize. These characters are reserved in HTML syntax, and using them literally in your markup will cause rendering errors or, worse, security vulnerabilities.
| Entity | Renders | Name | Why It Matters |
|---|---|---|---|
| < | < | Less-than | Opens an HTML tag; unencoded, the browser tries to parse what follows as a tag name |
| > | > | Greater-than | Closes an HTML tag; encoding is good practice even though browsers are more forgiving |
| & | & | Ampersand | Begins an entity reference; unencoded, the browser may misinterpret the following text |
| " | " | Double quote | Delimits attribute values; unencoded inside attributes, it can break out of the value |
| ' | ' | Single quote (apostrophe) | Also used to delimit attribute values; critical in single-quoted contexts |
Typographic Entities
Professional web typography relies heavily on HTML entities for proper punctuation. Using typographically correct characters instead of their ASCII approximations makes your content look polished and read more naturally. Here are the most commonly used typographic entities.
| Entity | Renders | Description |
|---|---|---|
| — | — | Em dash (long dash for parenthetical statements) |
| – | – | En dash (for ranges, e.g., 2020–2026) |
| … | … | Horizontal ellipsis (a single character, not three dots) |
| ‘ ’ | ‘ ’ | Left and right single quotation marks (curly quotes) |
| “ ” | “ ” | Left and right double quotation marks (curly quotes) |
| • | • | Bullet point |
| · | · | Middle dot (interpunct) |
| | (space) | Non-breaking space (prevents line break between words) |
Mathematical and Technical Symbols
Developers and technical writers frequently need mathematical symbols that are not available on a standard keyboard. HTML entities provide access to the full range of mathematical operators, comparison symbols, and set theory notation.
| Entity | Renders | Description |
|---|---|---|
| × | × | Multiplication sign |
| ÷ | ÷ | Division sign |
| ± | ± | Plus-minus sign |
| ≠ | ≠ | Not equal to |
| ≤ ≥ | ≤ ≥ | Less/greater than or equal to |
| ∞ | ∞ | Infinity |
| √ | √ | Square root |
| ∑ | ∑ | Summation (sigma) |
Currency Symbols
Displaying prices and financial information requires currency symbols from around the world. While some common currency symbols appear on most keyboards, many others require entity references.
| Entity | Renders | Currency |
|---|---|---|
| $ | $ | US Dollar |
| € | € | Euro |
| £ | £ | British Pound Sterling |
| ¥ | ¥ | Japanese Yen / Chinese Yuan |
| ₹ | ₹ | Indian Rupee (no named entity) |
| ₩ | ₩ | Korean Won (no named entity) |
Arrow Symbols
Arrows are used extensively in user interfaces, documentation, and technical writing. HTML provides named entities for the most common directional arrows.
| Entity | Renders | Description |
|---|---|---|
| ← | ← | Left arrow |
| → | → | Right arrow |
| ↑ | ↑ | Up arrow |
| ↓ | ↓ | Down arrow |
| ↔ | ↔ | Left-right arrow |
| ⇒ | ⇒ | Double right arrow (implies) |
When to Use Named vs Numeric Entities
Choosing between named and numeric entity references is a practical decision that depends on your specific situation.
Use named entities when the entity is one of the common, well-known ones like &, <,©, or —. Named entities make your source code readable and are easier for other developers to understand during code review. They also serve as self-documenting code: seeing instantly communicates intent, while   requires a lookup.
Use numeric references when dealing with characters that do not have named entities, when you need emoji or characters from non-Latin scripts, or when you want maximum compatibility across parsers and tools. Some older HTML processors may not recognize all named entities, but numeric references are universally supported.
Use the character directly (with UTF-8 encoding) for most non-reserved characters when your document is served with a proper charset=UTF-8 declaration. Modern browsers handle UTF-8 natively, so writing the copyright symbol directly (©) is just as valid as writing ©. The main exception is the five reserved characters listed above, which should always be encoded in HTML content contexts.
Common Mistakes to Avoid
Working with HTML entities has several common pitfalls that can lead to broken rendering or security vulnerabilities:
- Double encoding: Encoding an already-encoded string produces sequences like
&lt;which renders as the literal text "<" instead of the less-than sign. Always check whether your data is already encoded before applying encoding. - Missing semicolons: Forgetting the trailing semicolon (
&instead of&) can cause browsers to misinterpret the entity. While modern browsers are somewhat forgiving, always include the semicolon for reliability. - Wrong encoding context: HTML entity encoding is for HTML content. If you need to encode data for a URL, use URL encoding (percent-encoding) instead. For JavaScript strings, use JavaScript escaping. For JSON, use JSON string escaping.
- Encoding in the wrong layer: In modern frameworks like React, JSX automatically escapes text content. Adding manual HTML encoding on top of that produces visible entity text instead of the intended characters.
Encoding in Practice
The most efficient way to work with HTML entities in practice is to use a tool that handles the encoding for you. Our HTML Entity Encoder/Decoder supports all named entities, numeric references, and includes a searchable reference table. For security-focused encoding, the XSS Prevention mode encodes based on the specific HTML context (element content, attributes, JavaScript, CSS, or URLs) following OWASP guidelines.
For more on the security implications of proper encoding, see our XSS Prevention Guide. If you work with Unicode characters beyond the basic Latin set, our guide on Unicode in HTML covers character encoding, emoji, and common pitfalls in depth.
Further Reading
- HTML Living Standard — Character references
WHATWG specification for HTML character entity references.
- W3C HTML entities list
Complete list of named character references in HTML.
- Unicode.org
The Unicode Consortium home page with character charts and standards.