You are here: Reference > appendix > html > entities
HTML entity references
There are two additional ways in HTML documents to reference characters:
- a numeric character reference refers to a character
- an entity reference refers to a series of characters
Where entities are used, the referenced characters appear.
Numeric character references:
A numeric character reference can be specified in two formats:
&#nnnn; or &#xhhhh;
where the n decimal digits or the h hexadecimal characters identify the Unicode character code of the referenced character.
&#nnnn; or &#xhhhh;
where the n decimal digits or the h hexadecimal characters identify the Unicode character code of the referenced character.
Entity references:
An entity reference is an alternative name for a series of characters.
You can use an entity in the &name; format, where name is the name of the entity.
Custom entities cannot be declared in HTML (unlike in XML), but the HTML 4 Document Type Definitions (DTDs) provides several internal entities.
The following table contains these predefined entities in HTML:
Entity name | Character | Decimal reference | Hexadecimal reference |
---|---|---|---|
quot | " | " | " |
amp | & | & | & |
apos | ' | ' | ' |
lt | < | < | < |
gt | > | > | > |
nbsp |   |   | |
iexcl | ¡ | ¡ | ¡ |
cent | ¢ | ¢ | ¢ |
pound | £ | £ | £ |
curren | ¤ | ¤ | ¤ |
yen | ¥ | ¥ | ¥ |
brvbar | ¦ | ¦ | ¦ |
sect | § | § | § |
uml | ¨ | ¨ | ¨ |
copy | © | © | © |
ordf | ª | ª | ª |
laquo | « | « | « |
not | ¬ | ¬ | ¬ |
shy | | ­ | ­ |
reg | ® | ® | ® |
macr | ¯ | ¯ | ¯ |
deg | ° | ° | ° |
plusmn | ± | ± | ± |
sup2 | ² | ² | ² |
sup3 | ³ | ³ | ³ |
acute | ´ | ´ | ´ |
micro | µ | µ | µ |
para | ¶ | ¶ | ¶ |
middot | · | · | · |
cedil | ¸ | ¸ | ¸ |
sup1 | ¹ | ¹ | ¹ |
ordm | º | º | º |
raquo | » | » | » |
frac14 | ¼ | ¼ | ¼ |
frac12 | ½ | ½ | ½ |
frac34 | ¾ | ¾ | ¾ |
iquest | ¿ | ¿ | ¿ |
Agrave | À | À | À |
Aacute | Á | Á | Á |
Acirc | Â | Â | Â |
Atilde | Ã | Ã | Ã |
Auml | Ä | Ä | Ä |
Aring | Å | Å | Å |
AElig | Æ | Æ | Æ |
Ccedil | Ç | Ç | Ç |
Egrave | È | È | È |
Eacute | É | É | É |
Ecirc | Ê | Ê | Ê |
Euml | Ë | Ë | Ë |
Igrave | Ì | Ì | Ì |
Iacute | Í | Í | Í |
Icirc | Î | Î | Î |
Iuml | Ï | Ï | Ï |
ETH | Ð | Ð | Ð |
Ntilde | Ñ | Ñ | Ñ |
Ograve | Ò | Ò | Ò |
Oacute | Ó | Ó | Ó |
Ocirc | Ô | Ô | Ô |
Otilde | Õ | Õ | Õ |
Ouml | Ö | Ö | Ö |
times | × | × | × |
Oslash | Ø | Ø | Ø |
Ugrave | Ù | Ù | Ù |
Uacute | Ú | Ú | Ú |
Ucirc | Û | Û | Û |
Uuml | Ü | Ü | Ü |
Yacute | Ý | Ý | Ý |
THORN | Þ | Þ | Þ |
szlig | ß | ß | ß |
agrave | à | à | à |
aacute | á | á | á |
acirc | â | â | â |
atilde | ã | ã | ã |
auml | ä | ä | ä |
aring | å | å | å |
aelig | æ | æ | æ |
ccedil | ç | ç | ç |
egrave | è | è | è |
eacute | é | é | é |
ecirc | ê | ê | ê |
euml | ë | ë | ë |
igrave | ì | ì | ì |
iacute | í | í | í |
icirc | î | î | î |
iuml | ï | ï | ï |
eth | ð | ð | ð |
ntilde | ñ | ñ | ñ |
ograve | ò | ò | ò |
oacute | ó | ó | ó |
ocirc | ô | ô | ô |
otilde | õ | õ | õ |
ouml | ö | ö | ö |
divide | ÷ | ÷ | ÷ |
oslash | ø | ø | ø |
ugrave | ù | ù | ù |
uacute | ú | ú | ú |
ucirc | û | û | û |
uuml | ü | ü | ü |
yacute | ý | ý | ý |
thorn | þ | þ | þ |
yuml | ÿ | ÿ | ÿ |
OElig | Œ | Œ | Œ |
oelig | œ | œ | œ |
Scaron | Š | Š | Š |
scaron | š | š | š |
Yuml | Ÿ | Ÿ | Ÿ |
fnof | ƒ | ƒ | ƒ |
circ | ˆ | ˆ | ˆ |
tilde | ˜ | ˜ | ˜ |
Alpha | Α | Α | Α |
Beta | Β | Β | Β |
Gamma | Γ | Γ | Γ |
Delta | Δ | Δ | Δ |
Epsilon | Ε | Ε | Ε |
Zeta | Ζ | Ζ | Ζ |
Eta | Η | Η | Η |
Theta | Θ | Θ | Θ |
Iota | Ι | Ι | Ι |
Kappa | Κ | Κ | Κ |
Lambda | Λ | Λ | Λ |
Mu | Μ | Μ | Μ |
Nu | Ν | Ν | Ν |
Xi | Ξ | Ξ | Ξ |
Omicron | Ο | Ο | Ο |
Pi | Π | Π | Π |
Rho | Ρ | Ρ | Ρ |
Sigma | Σ | Σ | Σ |
Tau | Τ | Τ | Τ |
Upsilon | Υ | Υ | Υ |
Phi | Φ | Φ | Φ |
Chi | Χ | Χ | Χ |
Psi | Ψ | Ψ | Ψ |
Omega | Ω | Ω | Ω |
alpha | α | α | α |
beta | β | β | β |
gamma | γ | γ | γ |
delta | δ | δ | δ |
epsilon | ε | ε | ε |
zeta | ζ | ζ | ζ |
eta | η | η | η |
theta | θ | θ | θ |
iota | ι | ι | ι |
kappa | κ | κ | κ |
lambda | λ | λ | λ |
mu | μ | μ | μ |
nu | ν | ν | ν |
xi | ξ | ξ | ξ |
omicron | ο | ο | ο |
pi | π | π | π |
rho | ρ | ρ | ρ |
sigmaf | ς | ς | ς |
sigma | σ | σ | σ |
tau | τ | τ | τ |
upsilon | υ | υ | υ |
phi | φ | φ | φ |
chi | χ | χ | χ |
psi | ψ | ψ | ψ |
omega | ω | ω | ω |
thetasym | ϑ | ϑ | ϑ |
upsih | ϒ | ϒ | ϒ |
piv | ϖ | ϖ | ϖ |
ensp |   |   | |
emsp |   |   | |
thinsp |   |   | |
zwnj | | ‌ | ‌ |
zwj | | ‍ | ‍ |
lrm | | ‎ | ‎ |
rlm | | ‏ | ‏ |
ndash | – | – | – |
mdash | — | — | — |
lsquo | ‘ | ‘ | ‘ |
rsquo | ’ | ’ | ’ |
sbquo | ‚ | ‚ | ‚ |
ldquo | “ | “ | “ |
rdquo | ” | ” | ” |
bdquo | „ | „ | „ |
dagger | † | † | † |
Dagger | ‡ | ‡ | ‡ |
bull | • | • | • |
hellip | … | … | … |
permil | ‰ | ‰ | ‰ |
prime | ′ | ′ | ′ |
Prime | ″ | ″ | ″ |
lsaquo | ‹ | ‹ | ‹ |
rsaquo | › | › | › |
oline | ‾ | ‾ | ‾ |
frasl | ⁄ | ⁄ | ⁄ |
euro | € | € | € |
image | ℑ | ℑ | ℑ |
weierp | ℘ | ℘ | ℘ |
real | ℜ | ℜ | ℜ |
trade | ™ | ™ | ™ |
alefsym | ℵ | ℵ | ℵ |
larr | ← | ← | ← |
uarr | ↑ | ↑ | ↑ |
rarr | → | → | → |
darr | ↓ | ↓ | ↓ |
harr | ↔ | ↔ | ↔ |
crarr | ↵ | ↵ | ↵ |
lArr | ⇐ | ⇐ | ⇐ |
uArr | ⇑ | ⇑ | ⇑ |
rArr | ⇒ | ⇒ | ⇒ |
dArr | ⇓ | ⇓ | ⇓ |
hArr | ⇔ | ⇔ | ⇔ |
forall | ∀ | ∀ | ∀ |
part | ∂ | ∂ | ∂ |
exist | ∃ | ∃ | ∃ |
empty | ∅ | ∅ | ∅ |
nabla | ∇ | ∇ | ∇ |
isin | ∈ | ∈ | ∈ |
notin | ∉ | ∉ | ∉ |
ni | ∋ | ∋ | ∋ |
prod | ∏ | ∏ | ∏ |
sum | ∑ | ∑ | ∑ |
minus | − | − | − |
lowast | ∗ | ∗ | ∗ |
radic | √ | √ | √ |
prop | ∝ | ∝ | ∝ |
infin | ∞ | ∞ | ∞ |
ang | ∠ | ∠ | ∠ |
and | ∧ | ∧ | ∧ |
or | ∨ | ∨ | ∨ |
cap | ∩ | ∩ | ∩ |
cup | ∪ | ∪ | ∪ |
int | ∫ | ∫ | ∫ |
there4 | ∴ | ∴ | ∴ |
sim | ∼ | ∼ | ∼ |
cong | ≅ | ≅ | ≅ |
asymp | ≈ | ≈ | ≈ |
ne | ≠ | ≠ | ≠ |
equiv | ≡ | ≡ | ≡ |
le | ≤ | ≤ | ≤ |
ge | ≥ | ≥ | ≥ |
sub | ⊂ | ⊂ | ⊂ |
sup | ⊃ | ⊃ | ⊃ |
nsub | ⊄ | ⊄ | ⊄ |
sube | ⊆ | ⊆ | ⊆ |
supe | ⊇ | ⊇ | ⊇ |
oplus | ⊕ | ⊕ | ⊕ |
otimes | ⊗ | ⊗ | ⊗ |
perp | ⊥ | ⊥ | ⊥ |
sdot | ⋅ | ⋅ | ⋅ |
lceil | ⌈ | ⌈ | ⌈ |
rceil | ⌉ | ⌉ | ⌉ |
lfloor | ⌊ | ⌊ | ⌊ |
rfloor | ⌋ | ⌋ | ⌋ |
lang | 〈 | 〈 | 〈 |
rang | 〉 | 〉 | 〉 |
loz | ◊ | ◊ | ◊ |
spades | ♠ | ♠ | ♠ |
clubs | ♣ | ♣ | ♣ |
hearts | ♥ | ♥ | ♥ |
diams | ♦ | ♦ | ♦ |
Notes:
- the apos entity is not supported by Internet Explorer
- all entities are case sensitive, but the amp, copy, gt, lt, quot and req entities can also be used in uppercase (AMP, COPY, etc.).
Example 1:
This example illustrates the use of predefined entities in HTML documents:
|
||||
<body> 2 < 5 and 5 < 10 so 10 > 2 </body> |
||||
|
||||
Did you find this example helpful?
|
External links:
User Contributed Comments