HTML – ASCII Codes

ASCII (American Standard Code for Information Interchange) is a character encoding standard that represents characters in the English language using a 7-bit code. HTML allows you to include ASCII characters directly in your code, providing a wide range of symbols and special characters. In this post, we will explore HTML ASCII code references and provide an ASCII table for quick reference. Let’s dive in!

HTML allows you to represent ASCII characters using two methods: character entities and numeric character references.

Character Entities:

Character entities are special codes that represent specific characters within HTML. They are denoted by an ampersand (&) followed by a name or numeric code, and then a semicolon (;). Here are some commonly used ASCII character entities:

  • &lt; – Less than (<)
  • &gt; – Greater than (>)
  • &amp; – Ampersand (&)
  • &quot; – Double quote (")
  • &apos; – Single quote (')
  • &nbsp; – Non-breaking space

Numeric Character References:

Numeric character references allow you to represent ASCII characters using their decimal or hexadecimal code points. They are denoted by an ampersand (&), followed by a hash (#), followed by the decimal or hexadecimal code, and finally a semicolon (;). Here are some examples:

  • < – Less than (<)
  • > – Greater than (>)
  • & – Ampersand (&)
  • " – Double quote (")
  • ' – Single quote (')

Now, let’s take a look at an ASCII table that provides a reference for the ASCII characters and their corresponding decimal, hexadecimal, and character entity representations:

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

Feel free to refer to this ASCII table whenever you need to include specific ASCII characters in your HTML code. Remember, ASCII codes are limited to representing characters in the English language.

Using HTML ASCII codes, you can enhance your web content by incorporating symbols, special characters, and various textual representations.

Keep this reference handy and make the most of HTML’s ability to display ASCII characters in your web pages!