event.code names the physical key and never changes with your keyboard layout. event.key is the character that layout produces, so it does change, and it changes again when you hold Shift. keyCode is the deprecated legacy model, and for several keys, including Meta, there is no single value that is correct across browsers. The table below carries all three, with a note on every row where the answer is not the same everywhere.
Reuse and attribution
This table is published under CC BY 4.0. Quote it, embed it, ship it in your own documentation. All that is asked is a link back to https://mygearcheck.com/data/key-codes so the next person can check whether it has changed.
The code and key columns follow the W3C UI Events specifications for code values and key values, read 2026-08-05. The keyCode column holds the values the major browsers report on Windows and Linux under the legacy key model. Where a value is known to differ by browser or by operating system, the row carries a note and, where there is genuinely no stable answer, the cell is empty rather than filled with a plausible guess.
The key column is the unshifted result on a US QWERTY (ANSI) layout. On any other layout the same physical key produces a different character while the code stays identical, which is the entire reason code exists.
Letters: 26 keys
event.key
event.code
keyCode (deprecated)
Note
a
KeyA
65
b
KeyB
66
c
KeyC
67
d
KeyD
68
e
KeyE
69
f
KeyF
70
g
KeyG
71
h
KeyH
72
i
KeyI
73
j
KeyJ
74
k
KeyK
75
l
KeyL
76
m
KeyM
77
n
KeyN
78
o
KeyO
79
p
KeyP
80
q
KeyQ
81
r
KeyR
82
s
KeyS
83
t
KeyT
84
u
KeyU
85
v
KeyV
86
w
KeyW
87
x
KeyX
88
y
KeyY
89
z
KeyZ
90
Digits: 10 keys
event.key
event.code
keyCode (deprecated)
Note
0
Digit0
48
1
Digit1
49
2
Digit2
50
3
Digit3
51
4
Digit4
52
5
Digit5
53
6
Digit6
54
7
Digit7
55
8
Digit8
56
9
Digit9
57
Punctuation: 14 keys
event.key
event.code
keyCode (deprecated)
Note
`
Backquote
192
-
Minus
189
=
Equal
187
[
BracketLeft
219
]
BracketRight
221
\
Backslash
220
;
Semicolon
186
'
Quote
222
,
Comma
188
.
Period
190
/
Slash
191
\
IntlBackslash
226
The extra key next to the left Shift on ISO (European) keyboards. Absent on ANSI boards.
\
IntlRo
193
Japanese layouts only.
¥
IntlYen
255
Japanese layouts only. The keyCode is not consistent across browsers.
Whitespace and editing: 6 keys
event.key
event.code
keyCode (deprecated)
Note
(space)
Space
32
event.key is a single space character.
Enter
Enter
13
Tab
Tab
9
Backspace
Backspace
8
Delete
Delete
46
Insert
Insert
45
Navigation: 8 keys
event.key
event.code
keyCode (deprecated)
Note
ArrowUp
ArrowUp
38
ArrowDown
ArrowDown
40
ArrowLeft
ArrowLeft
37
ArrowRight
ArrowRight
39
Home
Home
36
End
End
35
PageUp
PageUp
33
PageDown
PageDown
34
Modifiers: 9 keys
event.key
event.code
keyCode (deprecated)
Note
Shift
ShiftLeft
16
Left and right Shift share keyCode 16. Only event.code (or the older event.location) tells them apart.
Shift
ShiftRight
16
Control
ControlLeft
17
Left and right Control share keyCode 17.
Control
ControlRight
17
Alt
AltLeft
18
On macOS this is the Option key. event.key is still "Alt".
Alt
AltRight
18
On many European layouts this key acts as AltGr and produces a character instead of a bare modifier.
Meta
MetaLeft
no stable value
Windows key, Command on macOS, Super on Linux. keyCode is not stable: browsers have reported 91, 93 and 224 for this key depending on OS and version. Use event.code or event.metaKey.
Meta
MetaRight
no stable value
Same instability as MetaLeft.
ContextMenu
ContextMenu
93
The menu key right of the space bar on many Windows keyboards.
Function keys: 12 keys
event.key
event.code
keyCode (deprecated)
Note
F1
F1
112
F2
F2
113
F3
F3
114
F4
F4
115
F5
F5
116
F6
F6
117
F7
F7
118
F8
F8
119
F9
F9
120
F10
F10
121
F11
F11
122
F12
F12
123
Numpad: 16 keys
event.key
event.code
keyCode (deprecated)
Note
0
Numpad0
96
With Num Lock off the numpad reports navigation keys instead.
1
Numpad1
97
2
Numpad2
98
3
Numpad3
99
4
Numpad4
100
5
Numpad5
101
6
Numpad6
102
7
Numpad7
103
8
Numpad8
104
9
Numpad9
105
/
NumpadDivide
111
*
NumpadMultiply
106
-
NumpadSubtract
109
+
NumpadAdd
107
Enter
NumpadEnter
13
Shares keyCode 13 with the main Enter. event.code is the only way to tell them apart.
.
NumpadDecimal
110
Some layouts produce a comma here.
System and lock: 6 keys
event.key
event.code
keyCode (deprecated)
Note
Escape
Escape
27
CapsLock
CapsLock
20
NumLock
NumLock
144
ScrollLock
ScrollLock
145
Intercepted by the OS on some systems, so the browser may never see it.
Pause
Pause
19
Often swallowed by the OS or by the browser's own shortcuts.
PrintScreen
PrintScreen
44
Windows and most Linux desktops handle this key themselves. Many browsers only ever see the keyup, never the keydown.
Changelog
1.0.0, 2026-08-05: first published. 107 keys across 9 groups.
The dataset is versioned, and the version number in the JSON response changes with the contents. If you find an error, report it: corrections are made and recorded here.