XML technologies / HTML & XHTML / Character Entities  

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

Characters outside the normal alphanumeric set, such as < and &, must be written as character entities, also called escape sequences or named characters, in HTML and XHTML documents. In (X)HTML, character entities begin with an ampersand ( &) and end with a semicolon (;). The character itself can be specified by its numerical character reference (Numerical Character Reference, NCR) or a predefined entity name.

A numerical character reference identifies a character by its Unicode codepoint, decimal or hexadecimal. Decimal character references use the syntax &#[Zahl]; and hexadecimal values include an “x”, as in &#x[Hex-wert];. For example, the less-than sign can be written as &#60; (decimal) or &#x3C; (hexadecimal).

Character entities abbreviate particular characters, such as &lt; for the less-than sign. They are predefined in the DTDs for the different (X)HTML variants. They help authors because they are easier to remember than numerical character references.

The ASCII character set

HTML and XHTML source uses the standard 7-bit ASCII character set. Its first 31 characters, not listed here, are device control characters such as backspace ( &08;) and carriage return ( &13;) and are unsuitable for use in HTML documents.

HTML 4.01 defines only four entities in this range: less than (<, &lt;), greater than (>, &gt;), ampersand ( &, &amp;) and quotation mark (", &quot;). They prevent confusion with the markup itself. XHTML additionally provides &apos;, which belongs to every XML language. Within XHTML attribute values, the & character must always be escaped. For better XML parser compatibility, numerical character references should always replace named characters for all character entities.

Decimal

entity

Symbol

Description

&#032;

Space

&#033;

!

Exclamation mark

&#034;

&quot;

"

Double quotation mark

&#035;

#

Number sign, hash

&#036;

$

Dollar sign

&#037;

%

Percent sign

&#038;

&amp;

&

Ampersand

&#039;

&apos; (XML/XHTML only)

'

Single quotation mark

&#040;

(

Left parenthesis

&#041;

)

Right parenthesis

&#042;

*

Asterisk

&#043;

+

Plus sign

&#044;

,

Comma

&#045;

-

Hyphen

&#046;

.

Period

&#047;

/

Slash

&#048; to &#057;

0–9

Digits 0 to 9

&#058;

:

Colon

&#059;

;

Semicolon

&#060;

&lt;

<

Less than

&#061;

=

Equals sign

&#062;

&gt;

>

Greater than

&#063;

?

Question mark

&#064;

@

At sign

&#065; to &#090;

A–Z

Letters A to Z

&#091;

[

Left square bracket

&#092;

\

Backslash

&#093;

]

Right square bracket

&#094;

^

Caret

&#095;

_

Underscore

&#096;

`

Grave accent (not a letter)

&#097; to &#122;

a–z

Letters a to z

&#123;

{

Left brace

&#124;

|

Vertical bar, pipe

&#125;

}

Right brace

&#126;

~

Tilde

Table: Extract from the ASCII character set

 

back to top

Nonstandard entities (&#130; to &#159;)

Character references numbered 130 to 159 are undefined in HTML and therefore invalid characters that should be avoided.

Browsers nevertheless support some nonstandard numerical entities in this range, such as &151; for the em dash. However, standards-compliant equivalents exist for these characters, listed in the General punctuation table. To display an em dash, use &8212; or &mdash;.

Latin-1 (ISO-8859-1)

Decimal

entity

Symbol

Description

&#160;

&nbsp;

Nonbreaking space

&#161;

&iexcl;

¡

Inverted exclamation mark

&#162;

&cent;

¢

Cent sign

&#163;

&pound;

£

Pound sign

&#164;

&curren;

¤

Generic currency sign

&#165;

&yen;

¥

Yen sign

&#166;

&brvbar;

¦

Broken bar

&#167;

&sect;

§

Section sign

&#168;

&uml;

¨

Diaeresis

&#169;

&copy;

©

Copyright

&#170;

&ordf;

ª

Feminine ordinal indicator

&#171;

&laquo;

«

Right angle quotation mark (US: left)

&#172;

&not;

¬

Not sign

&#173;

&shy;

-

Soft hyphen

&#174;

&reg;

®

Registered trademark

&#175;

&macr;

¯

Macron (overline)

&#176;

&deg;

°

Degree sign

&#177;

&plusmn;

±

Plus-minus

&#178;

&sup2;

²

Superscript two

&#179;

&sup3;

³

Superscript three

&#180;

&acute;

´

Acute accent (not a letter)

&#181;

&micro;

µ

Micro sign

&#182;

&para;

Pilcrow sign

&#183;

&middot;

·

Middle dot

&#184;

&cedil;

¸

Cedilla

&#185;

&sup1;

¹

Superscript one

&#186;

&ordm;

º

Masculine ordinal indicator

&#187;

&raquo;

»

Left angle quotation mark (US: right)

&#188;

&frac14;

¼

Fraction one quarter

&#189;

&frac12;

½

Fraction one half

&#190;

&frac34;

¾

Fraction three quarters

&#191;

&iquest;

¿

Inverted question mark

&#192;

&Agrave;

À

Capital A with grave accent

&#193;

&Aacute;

Á

Capital A with acute accent

&#194;

&Acirc;

Â

Capital A with circumflex

&#195;

&Atilde;

Ã

Capital A with tilde

&#196;

&Auml;

Ä

Capital A with diaeresis

&#197;

&Aring

Å

Capital A with ring

&#198;

&AElig;

Æ

Capital AE ligature

&#199;

&Ccedil;

Ç

Capital C with cedilla

&#200;

&Egrave

È

Capital E with grave accent

&#201;

&Eacute;

É

Capital E with acute accent

&#202;

&Ecirc;

Ê

Capital E with circumflex

&#203;

&Euml;

Ë

Capital E with diaeresis

&#204;

&Igrave;

Ì

Capital I with grave accent

&#205;

&Iacute;

Í

Capital I with acute accent

&#206;

&Icirc;

Î

Capital I with circumflex

&#207;

&Iuml;

Ï

Capital I with diaeresis

&#208;

&ETH;

Ð

Capital Eth, Icelandic

&#209;

&Ntilde;

Ñ

Capital N with tilde

&#210;

&Ograve;

Ò

Capital O with grave accent

&#211;

&Oacute;

Ó

Capital O with acute accent

&#212;

&Ocirc;

Ô

Capital O with circumflex

&#213;

&Otilde;

Õ

Capital O with tilde

&#214;

&Ouml;

Ö

Capital O with diaeresis

&#215;

&times;

×

Multiplication sign

&#216;

&Oslash;

Ø

Capital O with stroke

&#217;

&Ugrave;

Ù

Capital U with grave accent

&#218;

&Uacute;

Ú

Capital U with acute accent

&#219;

&Ucirc;

Û

Capital U with circumflex

&#220;

&Uuml;

Ü

Capital U with diaeresis

&#221;

&Yacute;

Ý

Capital Y with acute accent

&#222;

&THORN;

Þ

Capital Thorn, Icelandic

&#223;

&szlig;

ß

Small sz ligature, German

&#224;

&agrave;

à

Small a with grave accent

&#225;

&aacute;

á

Small a with acute accent

&#226;

&acirc;

â

Small a with circumflex

&#227;

&atilde;

ã

Small a with tilde

&#228;

&auml;

ä

Small a with diaeresis

&#229;

&aring;

å

Small a with ring

&#230;

&aelig;

æ

Small ae ligature

&#231;

&ccedil;

ç

Small c with cedilla

&#232;

&egrave;

è

Small e with grave accent

&#233;

&eacute;

é

Small e with acute accent

&#234;

&ecirc;

ê

Small e with circumflex

&#235;

&euml;

ë

Small e with diaeresis

&#236;

&igrave;

ì

Small i with grave accent

&#237;

&iacute;

í

Small i with acute accent

&#238;

&icirc;

î

Small i with circumflex

&#239;

&iuml;

ï

Small i with circumflex

&#240;

&eth;

ð

Small eth, Icelandic

&#241;

&ntilde;

ñ

Small n with tilde

&#242;

&ograve;

ò

Small o with grave accent

&#243;

&oacute;

ó

Small o with acute accent

&#244;

&ocirc;

ô

Small o with circumflex

&#245;

&otilde;

õ

Small o with tilde

&#246;

&ouml;

ö

Small o with diaeresis

&#247;

&divide;

÷

Division sign

&#248;

&oslash;

ø

Small o with stroke

&#249;

&ugrave;

ù

Small u with grave accent

&#250;

&uacute;

ú

Small u with acute accent

&#251;

&ucirc;

û

Small u with circumflex

&#252;

&uuml;

ü

Small u with diaeresis

&#253;

&yacute;

ý

Small y with acute accent

&#254;

&thorn;

þ

Small thorn, Icelandic

&#255;

&yuml;

ÿ

Small y with diaeresis

Table: Latin-1 (ISO-8859-1)

 

back to top

Latin Extended-A

Decimal

entity

Symbol

Description

&#338;

&OElig;

Œ

Capital OE ligature

&#339;

&oelig;

œ

Small oe ligature

&#352;

&Scaron;

Š

Capital S with caron

&#353;

&scaron;

š

Small s with caron

&#376

&Yuml;

Ÿ

Capital Y with diaeresis

Table: Latin Extended-A

 

back to top

Latin Extended-B

Decimal

entity

Symbol

Description

&#402;

&fnof;

ƒ

Florin

Table: Latin Extended-B

 

back to top

Other characters

Decimal

entity

Symbol

Description

&#710;

&circ;

ˆ

Circumflex

&#732;

&tilde;

˜

Tilde

Table: Other characters

 

back to top

Greek characters

Decimal

entity

Symbol

Description

&#913;

&Alpha;

Α

Capital Alpha

&#914;

&Beta;

Β

Capital Beta

&#915;

&Gamma;

Γ

Capital Gamma

&#916;

&Delta;

Δ

Capital Delta

&#917;

&Epsilon;

Ε

Capital Epsilon

&#918;

&Zeta;

Ζ

Capital Zeta

&#919;

&Eta;

Η

Capital Eta

&#920;

&Theta;

Θ

Capital Theta

&#921;

&Iota;

Ι

Capital Iota

&#922;

&Kappa;

Κ

Capital Kappa

&#923;

&Lambda;

Λ

Capital Lambda

&#924;

&Mu;

Μ

Capital Mu

&#925;

&Nu;

Ν

Capital Nu

&#926;

&Xi;

Ξ

Capital Xi

&#927;

&Omicron;

Ο

Capital Omicron

&#928;

&Pi;

Π

Capital Pi

&#929;

&Rho;

Ρ

Capital Rho

&#931;

&Sigma;

Σ

Capital Sigma

&#932;

&Tau;

Τ

Capital Tau

&#933;

&Upsilon;

Υ

Capital Upsilon

&#934;

&Phi;

Φ

Capital Phi

&#935;

&Chi;

Χ

Capital Chi

&#936;

&Psi;

Ψ

Capital Psi

&#937;

&Omega;

Ω

Capital Omega

&#945;

&alpha;

α

Small Alpha

&#946;

&beta;

β

Small Beta

&#947;

&gamma;

γ

Small Gamma

&#948;

&delta;

δ

Small Delta

&#949;

&epsilon;

ε

Small Epsilon

&#950;

&zeta;

ζ

Small Zeta

&#951;

&eta;

η

Small Eta

&#952;

&theta;

θ

Small Theta

&#953;

&iota;

ι

Small Iota

&#954;

&kappa;

κ

Small Kappa

&#955;

&lambda;

λ

Small Lambda

&#956;

&mu;

μ

Small Mu

&#957;

&nu;

ν

Small Nu

&#958;

&xi;

ξ

Small Xi

&#959;

&omicron;

ο

Small Omicron

&#960;

&pi;

π

Small Pi

&#961;

&rho;

ρ

Small Rho

&#962;

&sigmaf;

ς

Small final Sigma

&#963;

&sigma;

σ

Small Sigma

&#964;

&tau;

τ

Small Tau

&#965;

&upsilon;

υ

Small Upsilon

&#966;

&phi;

φ

Small Phi

&#967;

&chi;

χ

Small Chi

&#968;

&psi;

ψ

Small Psi

&#969;

&omega;

ω

Small Omega

&#977;

&thetasym;

ϑ

Small Theta

&#978;

&upsih;

ϒ

Greek Upsilon with caron

&#982;

&piv;

ϖ

Greek Pi symbol

Table: Greek characters

 

back to top

 

General punctuation

Decimal

entity

Symbol

Description

&#8194;

&ensp;

En space

&#8195;

&emsp;

Em space

&#8201;

&thinsp;

Thin space

&#8204;

&zwnj;

Zero-width non-joiner

&#8205;

&zwj;

Zero-width joiner

&#8206;

&lrm;

Left-to-right mark

&#8207

&rlm;

Right-to-left mark

&#8211;

&ndash;

-

En dash

&#8212;

&mdash;

—

Em dash

&#8216;

&lsquo;

‘

Right single quotation mark (US: left)

&#8217;

&rsquo;

’

Apostrophe (US: right single quotation mark)

&#8218;

&sbquo;

‚

Left single quotation mark

&#8220;

&ldquo;

“

Upper right double quotation mark (US: left)

&#8221;

&rdquo;

”

US: upper right double quotation mark

&#8222;

&bdquo;

„

Lower left double quotation mark

&#8224;

&dagger;

†

Dagger

&#8225;

&Dagger;

‡

Double dagger

&#8226;

&bull;

•

Bullet

&#8230;

&hellep;

...

Ellipsis

&#8240;

&permil;

‰

Per mille sign

&#8242;

&prime;

′

Minute or foot sign

&#8243;

&Prime;

″

Second or inch sign

&#8249;

&lsaquo;

‹

Left or right single angle quotation mark (nonstandard)

&#8250;

&rsaquo;

›

Right or left single angle quotation mark (nonstandard)

&#8254;

&oline;

‾

Overline

&#8260;

&frasl;

/

Fraction slash

&#8364;

&euro;

€

Euro sign

Table: General punctuation

 

back to top

Letterlike symbols

Decimal

entity

Symbol

Description

&#8465;

&image;

ℑ

Imaginary sign

&#8472;

&weierp;

℘

Weierstrass P

&#8476;

&real;

ℜ

Real sign

&#8482;

&trade;

™

Trademark sign

&#8501;

&alefsym;

ℵ

Mathematical aleph symbol

Table: Letterlike symbols

 

back to top

Arrows

Decimal

entity

Symbol

Description

&#8592;

&larr;

←

Left arrow

&#8593;

&uarr;

↑

Up arrow

&#8594;

&rarr;

→

Right arrow

&#8595;

&darr;

↓

Down arrow

&#8596;

&harr;

↔

Left-right arrow

&#8629;

&crarr;

↵

Down arrow with corner to the left

&#8656;

&lArr;

⇐

Left double arrow

&#8657;

&uArr;

⇑

Up double arrow

&#8658;

&rArr;

⇒

Right double arrow

&#8659;

&dArr;

⇓

Down double arrow

&#8660;

&hArr;

⇔

Left-right double arrow

Table: Arrows

 

back to top

Mathematical operators

Decimal

entity

Symbol

Description

&#8704;

&forall;

∀

For all

&#8706;

&part;

∂

Partial derivative

&#8707;

&exist;

∃

Exists

&#8709;

&empty;

∅

Empty set

&#8711;

&nabla;

∇

Nabla, gradient

&#8712;

&isin;

∈

Is an element of

&#8713

&notin;

∉

Is not an element of

&#8715;

&ni;

∋

Contains as an element

&#8719;

&prod;

∏

Product sign

&#8721;

&sum;

∑

Summation sign

&#8722;

&minus;

−

Minus sign

&#8727;

&lowast;

*

Asterisk operator

&#8730;

&radic;

√

Square root

&#8733;

&prop;

∝

Proportional sign

&#8734;

&infin;

∞

Infinity sign

&#8736;

&ang;

∠

Angle

&#8743;

&and;

∧

Logical AND

&#8744;

&or;

∨

Logical OR

&#8745;

&cap;

∩

Intersection

&#8746;

&cup;

∪

Union

&#8747;

&int;

∫

Integral sign

&#8756;

&there4;

∴

Therefore

&#8764;

&sim;

~

Similar to

&#8773;

&cong;

≅

Approximately equal

&#8776;

&ap;

≈

Approximately

&#8800;

&ne;

≠

Not equal

&#8801;

&equiv;

≡

Identical

&#8804;

&le;

≤

Less than or equal to

&#8805;

&ge;

≥

Greater than or equal to

&#8834;

&sub;

⊂

Subset of

&#8835;

&sup;

⊃

Superset of

&#8836;

&nsub;

⊄

Not a subset of

&#8838;

&sube

⊆

Subset of or equal to

&#8839;

&supe

⊇

Superset of or equal to

&#8853;

&oplus;

⊕

Direct sum

&#8855;

&otimes;

⊗

Vector product

&#8869;

&perp;

⊥

Orthogonal, perpendicular to

&#8901;

&sdot;

⋅

Dot operator

Table: Mathematical operators

 

back to top

Other technical symbols

Decimal

entity

Symbol

Description

&#8968;

&lceil;

⌈

Large upper-left square bracket

&#8969;

&rceil;

⌉

Large upper-right square bracket

&#8970;

&lfloor;

⌊

Large lower-left square bracket

&#8971;

&rfloor

⌋

Large lower-right square bracket

&#9001;

&lang;

〈

Large left angle bracket

&#9002;

&rang;

〉

Large right angle bracket

Table: Other technical symbols

 

back to top

Geometric shapes

Decimal

entity

Symbol

Description

&#9674;

&loz;

◊

Lozenge

Table: Geometric shapes

 

back to top

Miscellaneous symbols

Decimal

entity

Symbol

Description

&#9824;

&spades;

♠

Spade sign

&#9827;

&clubs

♣

Club sign

&#9829;

&hearts;

♥

Heart sign

&#9830;

&diams

♦

Diamond sign

Table: Miscellaneous symbols

 

back to top

   

 

 

 

back to top