Char Codes (Key Codes) - JavaScript
Get the full list Javascript Char Codes (Key Codes). Press a key in the text box below to see the corresponding Javascript key code. The charCode property returns the Unicode character code of the key that triggered the onkeypress event.
Key | Code | Key | Code |
---|---|---|---|
backspace | 8 | u | 85 |
tab | 9 | v | 86 |
enter | 13 | w | 87 |
shift | 16 | x | 88 |
ctrl | 17 | y | 89 |
alt | 18 | z | 90 |
pause/break | 19 | left window key | 91 |
caps lock | 20 | right window key | 92 |
escape | 27 | select key | 93 |
page up | 33 | numpad 0 | 96 |
page down | 34 | numpad 1 | 97 |
end | 35 | numpad 2 | 98 |
home | 36 | numpad 3 | 99 |
left arrow | 37 | numpad 4 | 100 |
up arrow | 38 | numpad 5 | 101 |
right arrow | 39 | numpad 6 | 102 |
down arrow | 40 | numpad 7 | 103 |
insert | 45 | numpad 8 | 104 |
delete | 46 | numpad 9 | 105 |
0 | 48 | multiply | 106 |
1 | 49 | add | 107 |
2 | 50 | subtract | 109 |
3 | 51 | decimal point | 110 |
4 | 52 | divide | 111 |
5 | 53 | f1 | 112 |
6 | 54 | f2 | 113 |
7 | 55 | f3 | 114 |
8 | 56 | f4 | 115 |
9 | 57 | f5 | 116 |
a | 65 | f6 | 117 |
b | 66 | f7 | 118 |
c | 67 | f8 | 119 |
d | 68 | f9 | 120 |
e | 69 | f10 | 121 |
f | 70 | f11 | 122 |
g | 71 | f12 | 123 |
h | 72 | num lock | 144 |
i | 73 | scroll lock | 145 |
j | 74 | semi-colon | 186 |
k | 75 | equal sign | 187 |
l | 76 | comma | 188 |
m | 77 | dash | 189 |
n | 78 | period | 190 |
o | 79 | forward slash | 191 |
p | 80 | grave accent | 192 |
q | 81 | open bracket | 219 |
r | 82 | back slash | 220 |
s | 83 | close braket | 221 |
t | 84 | single quote | 222 |
The Unicode character code is the number of a character (e.g. the number "97" represents the letter "a"). A cross-browser solution to get the Unicode value of the pressed keyboard key: var x = event.charCode || event.keyCode;