HTML escape characters (HTML entities) let you display characters that would
otherwise be interpreted as code, or that aren't easy to type directly. Every
entity starts with & and ends with ; — for example, & renders as &.
This reference lists the entities you'll actually use, grouped by category, with
their named and numeric forms.
Two ways to write any entity: a named form (©) and a numeric
form (© decimal or © hex). Named entities are more readable;
numeric entities work for any Unicode character even without a name.
Reserved Characters (Must Escape)
These have special meaning in HTML and must be escaped to display literally or to avoid breaking your markup.
| Character | Named Entity | Numeric | Description |
|---|---|---|---|
& | & | & | Ampersand |
< | < | < | Less-than sign |
> | > | > | Greater-than sign |
" | " | " | Double quote |
' | ' | ' | Single quote / apostrophe |
Spaces & Punctuation
| Character | Named Entity | Numeric | Description |
|---|---|---|---|
| (space) | |   | Non-breaking space |
| – | – | – | En dash |
| — | — | — | Em dash |
| … | … | … | Horizontal ellipsis |
| ‘ | ‘ | ‘ | Left single quote |
| ’ | ’ | ’ | Right single quote |
| “ | “ | “ | Left double quote |
| ” | ” | ” | Right double quote |
| · | · | · | Middle dot |
| † | † | † | Dagger |
Currency Symbols
| Symbol | Named Entity | Numeric | Description |
|---|---|---|---|
| ¢ | ¢ | ¢ | Cent |
| £ | £ | £ | Pound sterling |
| € | € | € | Euro |
| ¥ | ¥ | ¥ | Yen |
| ₹ | — | ₹ | Indian Rupee |
| $ | — | $ | Dollar (no escaping needed) |
Common Symbols
| Symbol | Named Entity | Numeric | Description |
|---|---|---|---|
| © | © | © | Copyright |
| ® | ® | ® | Registered trademark |
| ™ | ™ | ™ | Trademark |
| ° | ° | ° | Degree |
| § | § | § | Section |
| ¶ | ¶ | ¶ | Paragraph (pilcrow) |
| • | • | • | Bullet |
Math & Technical Symbols
| Symbol | Named Entity | Numeric | Description |
|---|---|---|---|
| × | × | × | Multiplication sign |
| ÷ | ÷ | ÷ | Division sign |
| ± | ± | ± | Plus-minus |
| ≠ | ≠ | ≠ | Not equal to |
| ≤ | ≤ | ≤ | Less than or equal |
| ≥ | ≥ | ≥ | Greater than or equal |
| ∞ | ∞ | ∞ | Infinity |
| √ | √ | √ | Square root |
| ½ | ½ | ½ | One half |
| ¼ | ¼ | ¼ | One quarter |
Arrows
| Symbol | Named Entity | Numeric | Description |
|---|---|---|---|
| ← | ← | ← | Left arrow |
| → | → | → | Right arrow |
| ↑ | ↑ | ↑ | Up arrow |
| ↓ | ↓ | ↓ | Down arrow |
| ↔ | ↔ | ↔ | Left-right arrow |
| ⇒ | ⇒ | ⇒ | Double right arrow |
Accented & Special Letters
| Character | Named Entity | Numeric | Description |
|---|---|---|---|
| á | á | á | a with acute |
| é | é | é | e with acute |
| ñ | ñ | ñ | n with tilde |
| ü | ü | ü | u with umlaut |
| ç | ç | ç | c with cedilla |
| ø | ø | ø | o with stroke |
| ß | ß | ß | Sharp s (eszett) |
Golden Rules for HTML Escaping
- Always escape the big three —
<,>, and&— in any content that could be interpreted as markup. - Escape quotes inside attributes — use
"(or'for single quotes) when a quote character appears inside an attribute value. - Escaping is your first defense against XSS — never inject unescaped user input into HTML. Let your framework or a trusted library escape it.
- Prefer UTF-8 over entities for regular text — with a UTF-8 charset you
can type é or → directly; reserve entities for reserved characters and
invisible ones like
. - Numeric entities always work — if a character has no named entity, use
its numeric (
₹) or hex (₹) code point.
Frequently Asked Questions
What are HTML escape characters?
They're special codes (HTML entities) that represent characters which are
reserved in HTML or hard to type. Each starts with & and ends with ;, such
as & for &.
Which characters must be escaped in HTML?
At minimum, escape & (&), < (<), and > (>). Inside
attribute values, also escape quotes with " or '.
What is the difference between named and numeric entities?
Named entities like © are readable but limited to characters that have a
defined name. Numeric entities like © work for any Unicode character
using its code point, in decimal or hex.
How do I add a non-breaking space in HTML?
Use . It renders as a space that won't collapse or break onto a new
line, useful for keeping words or values together.
Why should I escape user input? Unescaped user input can be interpreted as HTML or script, leading to cross-site scripting (XSS) attacks. Escaping reserved characters ensures the input is displayed as text, not executed as code.
Do I still need entities if my page uses UTF-8?
For most visible characters, no — you can type them directly. You still need
entities for the reserved characters (&, <, >) and for invisible or
ambiguous characters like non-breaking spaces.