Using Special Characters in HTML Documents

You may be familiar with the special characters such as the registered trademark ® or copyright symbol © that can be entered in a document by using the ALT-key combination, e.g. ALT+0174 can be used to enter a registered trademark symbol. The numbers in the ALT-key combination must be entered using the numeric keypad and NOT the numbers on top of the keyboard. Click here for a complete listing of special characters.

But what if you want to enter these special characters in an HTML document? You can enter these special characters into an HTML document using a special notation known as "character entities". You may enter these entities either by using their character names, such as &reg for the registered trademark symbol, or by entering their character number, such as &#174. Notice the similarity in ALT+0174 and &#174. They both end with the number 174. This means that you can use these characters in Word, Excel, or other programs by using the ALT-key combination with the characters listed below. Keep in mind that even though HTML commands are not case-sensitive, these character entities are case sensitive.

Here's one cool usage of these character entities. Spammers like to spam the Web pages and obtain the email addresses. You can protect your Web site from spammers by writing the email addresses on your Web site as character entities, instead of the standard characters. This would make it extremely hard for spambots to decipher your email addresses. For instance, if you have an email address on your contact page such as a@b.com, you can enter the following in your html code:

email us at <a href="mailto:&#97;&#64;&#98;&#46;&#99;&#111;&#109">a@b.com

The Web page will display:

email us at a@b.com

Most browsers support the following character entities. The list is sorted by the character number.

Character Number Character Name Display Output
&#32;   Blank space
&#33;   !
&#34; &quot; "
&#35;   #
&#36;   $
&#37;   %
&#38; &amp; &
&#39;   '
&#40;   (
&#41;   )
&#42;   *
&#43;   +
&#44;   ,
&#45;   -
&#46;   .
&#47;   /
&#48;   0
&#49;   1
&#50;   2
&#51;   3
&#52;   4
&#53;   5
&#54;   6
&#55;   7
&#56;   8
&#57;   9
&#58;   :
&#59;   ;
&#60; &lt; <
&#61;   =
&#62; &gt; >
&#63;   ?
&#64;   @
&#65;   A
&#66;   B
&#67;   C
&#68;   D
&#69;   E
&#70;   F
&#71;   G
&#72;   H
&#73;   I
&#74;   J
&#75;   K
&#76;   L
&#77;   M
&#78;   N
&#79;   O
&#80;   P
&#81;   Q
&#82;   R
&#83;   S
&#84;   T
&#85;   U
&#86;   V
&#87;   W
&#88;   X
&#89;   Y
&#90;   Z
&#91;   [
&#92;   \
&#93;   ]
&#94;   ^
&#95;   _
&#96;   `
&#97;   a
&#98;   b
&#99;   c
&#100;   d
&#101;   e
&#102;   f
&#103;   g
&#104;   h
&#105;   i
&#106;   j
&#107;   k
&#108;   l
&#109;   m
&#110;   n
&#111;   o
&#112;   p
&#113;   q
&#114;   r
&#115;   s
&#116;   t
&#117;   u
&#118;   v
&#119;   w
&#120;   x
&#121;   y
&#122;   z
&#123;   {
&#124;   |
&#125;   }
&#126;   ~

The following character entities don't seem to work on older browsers but will work on IE and Netscape versions 3 and higher.

Character Number Character Name Display Output
&#127;   
&#128;  
&#129;  
&#130;  
&#131;   ƒ
&#132;  
&#133;  
&#134;  
&#135;  
&#136;   ˆ
&#137;  
&#138;   Š
&#139;  
&#140;   Œ
&#141;  
&#142;   Ž
&#143;  
&#144;  
&#145;  
&#146;  
&#147;  
&#148;  
&#149;  
&#150;  
&#151;  
&#152;   ˜
&#153; &trade;
&#154;   š
&#155;  
&#156;   œ
&#157;  
&#158;   ž
&#159;   Ÿ
&#160; &nbsp;  
&#161; &iexcl; ¡
&#162; &cent; ¢
&#163; &pound; £
&#164; &curren; ¤
&#165; &yen; ¥
&#166; &brvbar; ¦
&#167; &sect; §
&#168; &uml; ¨
&#169; &copy; ©
&#170; &ordf; ª
&#171; &laquo; «
&#172; &not; ¬
&#173; &shy; ­
&#174; &reg; ®
&#175; &macr; ¯
&#176; &deg; °
&#177; &plusmn; ±
&#178; &sup2; ²
&#179; &sup3; ³
&#180; &acute; ´
&#181; &micro; µ
&#182; &para;