An HTML entity writes a character as &name; or as a number © (decimal) or © (hex), so that it can be typed anywhere and cannot be mistaken for markup. Encode text with the HTML Entity Encode and decode it with the HTML Entity Decode. The numbers shown are the Unicode code points (Unicode).
Common entities
| Character | Name | Number | Meaning |
|---|---|---|---|
& |
& |
& |
Ampersand |
< |
< |
< |
Less-than |
> |
> |
> |
Greater-than |
" |
" |
" |
Double quote |
| ' | ' |
' |
Apostrophe (HTML5 and XML) |
nbsp |
|
  |
Non-breaking space |
| © | © |
© |
Copyright |
| ® | ® |
® |
Registered |
| ™ | ™ |
™ |
Trademark |
| € | € |
€ |
Euro |
| £ | £ |
£ |
Pound |
| ¥ | ¥ |
¥ |
Yen |
| ¢ | ¢ |
¢ |
Cent |
| § | § |
§ |
Section |
| ° | ° |
° |
Degree |
| ± | ± |
± |
Plus or minus |
| × | × |
× |
Multiplication |
| ÷ | ÷ |
÷ |
Division |
| ½ | ½ |
½ |
One half |
| … | … |
… |
Ellipsis |
| – | – |
– |
En dash |
| — | — |
— |
Em dash |
| ‘ | ‘ |
‘ |
Left single quote |
| ’ | ’ |
’ |
Right single quote / apostrophe |
| “ | “ |
“ |
Left double quote |
| ” | ” |
” |
Right double quote |
| « | « |
« |
Left angle quote |
| » | » |
» |
Right angle quote |
| • | • |
• |
Bullet |
| · | · |
· |
Middle dot |
| ← | ← |
← |
Left arrow |
| → | → |
→ |
Right arrow |
| ↑ | ↑ |
↑ |
Up arrow |
| ↓ | ↓ |
↓ |
Down arrow |
| ♥ | ♥ |
♥ |
Heart |
| ✓ | ✓ |
✓ |
Check mark (HTML5) |
| ñ | ñ |
ñ |
n with tilde |
| é | é |
é |
e acute |
| ü | ü |
ü |
u umlaut |
The five you must escape
In HTML text, &, < and > must be escaped (&, <, >). Inside a double-quoted attribute also escape " ("), and in a single-quoted one ' ('). Escaping on output is the main defence against Cross-site scripting (XSS) when you show user input.
Good to know
stops a line break between two words, for example in10 km. It is not a general layout tool.- Entities are decoded once.
&lt;shows the text<, not<. - Numeric forms work for any code point; named ones exist only for a fixed list.
- Always include the semicolon. Some old named entities work without it, but not reliably.
- With UTF-8 pages you do not need entities for accented letters or the euro sign; type them directly.