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