A JavaScript keycode finder shows the KeyboardEvent properties your browser reports when you press a key. Inspect event.key, event.code, keyCode, which and modifiers, copy a shortcut snippet, and search the key codes list without signing up.
Press a key. Inspect the event.
Click or focus the capture area, then press a physical keyboard key or combination. Tab moves to the next control; Escape leaves capture. Both preserve your last captured key. Browser and operating-system shortcuts may not reach this page. Events are captured only here, never elsewhere on the page.
On a phone or without a physical keyboard? Try a labeled example. Soft keyboards often emit input events instead of useful key codes.
No key captured yet.
event.key
—
event.code
—
event.keyCode (deprecated)
—
event.which (deprecated)
—
ctrlKey
—
altKey
—
shiftKey
—
metaKey
—
location
—
repeat
—
isComposing
—
Legacy keyCode and which values above come directly from the event. They may be 0 or differ by browser, layout or input method. Prefer key or code in new code.
This condition matches all four modifier states exactly and ignores repeats and composition. If code is empty, it uses key instead. Test shortcuts on the browsers and keyboard layouts you support.
JavaScript key codes list
Search 117 common physical keys, including letters, digits, punctuation, function keys and numpad keys. These are unshifted US-layout examples, not an exhaustive list of every language or device. Numpad examples assume Num Lock is on. Legacy numbers vary; capture an actual event to check your browser.
event.key
event.code
Legacy keyCode
Location
Backspace
Backspace
8
Standard (0)
Tab
Tab
9
Standard (0)
Enter
Enter
13
Standard (0)
Enter
NumpadEnter
13
Numpad (3)
Shift
ShiftLeft
16
Left (1)
Shift
ShiftRight
16
Right (2)
Control
ControlLeft
17
Left (1)
Control
ControlRight
17
Right (2)
Alt
AltLeft
18
Left (1)
Alt
AltRight
18
Right (2)
Pause
Pause
19
Standard (0)
CapsLock
CapsLock
20
Standard (0)
Escape
Escape
27
Standard (0)
Space
Space
32
Standard (0)
PageUp
PageUp
33
Standard (0)
PageDown
PageDown
34
Standard (0)
End
End
35
Standard (0)
Home
Home
36
Standard (0)
ArrowLeft
ArrowLeft
37
Standard (0)
ArrowUp
ArrowUp
38
Standard (0)
ArrowRight
ArrowRight
39
Standard (0)
ArrowDown
ArrowDown
40
Standard (0)
PrintScreen
PrintScreen
44
Standard (0)
Insert
Insert
45
Standard (0)
Delete
Delete
46
Standard (0)
0
Digit0
48
Standard (0)
1
Digit1
49
Standard (0)
2
Digit2
50
Standard (0)
3
Digit3
51
Standard (0)
4
Digit4
52
Standard (0)
5
Digit5
53
Standard (0)
6
Digit6
54
Standard (0)
7
Digit7
55
Standard (0)
8
Digit8
56
Standard (0)
9
Digit9
57
Standard (0)
a
KeyA
65
Standard (0)
b
KeyB
66
Standard (0)
c
KeyC
67
Standard (0)
d
KeyD
68
Standard (0)
e
KeyE
69
Standard (0)
f
KeyF
70
Standard (0)
g
KeyG
71
Standard (0)
h
KeyH
72
Standard (0)
i
KeyI
73
Standard (0)
j
KeyJ
74
Standard (0)
k
KeyK
75
Standard (0)
l
KeyL
76
Standard (0)
m
KeyM
77
Standard (0)
n
KeyN
78
Standard (0)
o
KeyO
79
Standard (0)
p
KeyP
80
Standard (0)
q
KeyQ
81
Standard (0)
r
KeyR
82
Standard (0)
s
KeyS
83
Standard (0)
t
KeyT
84
Standard (0)
u
KeyU
85
Standard (0)
v
KeyV
86
Standard (0)
w
KeyW
87
Standard (0)
x
KeyX
88
Standard (0)
y
KeyY
89
Standard (0)
z
KeyZ
90
Standard (0)
Meta
MetaLeft
91
Left (1)
Meta
MetaRight
92
Right (2)
ContextMenu
ContextMenu
93
Standard (0)
0
Numpad0
96
Numpad (3)
1
Numpad1
97
Numpad (3)
2
Numpad2
98
Numpad (3)
3
Numpad3
99
Numpad (3)
4
Numpad4
100
Numpad (3)
5
Numpad5
101
Numpad (3)
6
Numpad6
102
Numpad (3)
7
Numpad7
103
Numpad (3)
8
Numpad8
104
Numpad (3)
9
Numpad9
105
Numpad (3)
*
NumpadMultiply
106
Numpad (3)
+
NumpadAdd
107
Numpad (3)
-
NumpadSubtract
109
Numpad (3)
.
NumpadDecimal
110
Numpad (3)
/
NumpadDivide
111
Numpad (3)
F1
F1
112
Standard (0)
F2
F2
113
Standard (0)
F3
F3
114
Standard (0)
F4
F4
115
Standard (0)
F5
F5
116
Standard (0)
F6
F6
117
Standard (0)
F7
F7
118
Standard (0)
F8
F8
119
Standard (0)
F9
F9
120
Standard (0)
F10
F10
121
Standard (0)
F11
F11
122
Standard (0)
F12
F12
123
Standard (0)
F13
F13
124
Standard (0)
F14
F14
125
Standard (0)
F15
F15
126
Standard (0)
F16
F16
127
Standard (0)
F17
F17
128
Standard (0)
F18
F18
129
Standard (0)
F19
F19
130
Standard (0)
F20
F20
131
Standard (0)
F21
F21
132
Standard (0)
F22
F22
133
Standard (0)
F23
F23
134
Standard (0)
F24
F24
135
Standard (0)
NumLock
NumLock
144
Numpad (3)
ScrollLock
ScrollLock
145
Standard (0)
;
Semicolon
186
Standard (0)
=
Equal
187
Standard (0)
,
Comma
188
Standard (0)
-
Minus
189
Standard (0)
.
Period
190
Standard (0)
/
Slash
191
Standard (0)
`
Backquote
192
Standard (0)
[
BracketLeft
219
Standard (0)
\
Backslash
220
Standard (0)
]
BracketRight
221
Standard (0)
'
Quote
222
Standard (0)
\
IntlBackslash
226
Standard (0)
How to inspect JavaScript keyboard events
1. Focus the capture area
Click the labeled capture area or reach it with Tab.
2. Press a key or combination
Inspect the values reported by your browser, or try a clearly labeled example.
3. Choose a matching strategy
Choose code for physical position or key for the logical key, then copy the exact modifier-aware condition.
4. Check the reference
Search the common US key list and compare against actual events on your target browsers.
JavaScript key codes FAQ
What is a JavaScript keycode finder?
A JavaScript keycode finder displays the KeyboardEvent values your browser reports when you press a key. Use this tool to inspect event.key, event.code, legacy keyCode and which, location and modifier states, then copy a shortcut condition.
What is the difference between event.key and event.code?
event.key identifies the logical key or character, accounting for modifiers and keyboard layout. event.code identifies the physical key position: the key at the US Q position reports KeyQ even when another layout assigns a different character. Choose key for character-based actions and code for physical controls.
Should I use keyCode or which in new JavaScript?
No. keyCode and which are deprecated and can vary between browsers, layouts and input methods. Prefer key or code. This tool displays the native legacy values for debugging existing code and labels reference numbers as common US examples.
Why do some keys not appear, especially on phones?
The operating system or browser may reserve a shortcut before the page receives it. Virtual keyboards, speech input and input-method editors may produce input or composition events with limited KeyboardEvent values. Use a physical keyboard when inspecting code and location; the example buttons are demonstrations, not hardware tests.
Does this tool record what I type elsewhere?
No. The tool handles keydown only in the focused capture area. It does not install a global keyboard listener, upload keystrokes or save event data. The latest event disappears when the page reloads. Tab navigates away and Escape leaves capture, preserving the last captured key for copying.