keecode logokeecode

JavaScript KeyCode Reference

Quick lookup for event.keyCode, event.key, and event.code

Press Any Key

Start typing to see key codes

⌨️

Popular Keycodes

Quick access to the most commonly used keyboard keys

Complete Keycode Reference

Browse and search all JavaScript keyboard event codes

JavaScript Keycodes

Click on any code to see more details.

Key CodeKeyCode
Unicode
Description
CancelPausebreak
BackspaceBackspace
backspace / delete
TabTab
tab
ClearNumLock
clear
EnterEnter
Enter / Return
ShiftShiftRight
shift
ShiftShiftLeft
shift
ControlControlLeft
ctrl
ControlControlRight
ctrl
AltAltRight
Alt / Option
AltAltLeft
Alt / Option
PausePausepause/break
CapsLockCapsLock
caps lock
UnidentifiedLang1hangul
UnidentifiedLang2hanja
EscapeEscape
escape
henkanconversion
muhenkannon-conversion
(blank space)Spacespacebar
PageUpNumpad9
page up
PageDownNumpad3
page down
EndNumpad1end
HomeNumpad7
home
ArrowLeftArrowLeft
left arrow
ArrowUpArrowUp
up arrow
ArrowRightArrowRight
right arrow
ArrowDownArrowDown
down arrow
Selectselect
Printprint
Executeexecute
F13F13
Print Screen / F13 (firefox)
InsertNumpad0
insert
DeleteNumpadDecimal
delete
Help
help
Digit0
apostrophe
ºDigit0
ordinal indicator
0Digit0
0
1Digit1
1 Key
¡Digit1
inverted exclamation mark
!Digit1
exclamation mark
@Digit2
at sign
Digit2
trademark
2Digit2
2 Key
²Digit2
sqaure
³Digit3
cube
#Digit3
hash
3Digit3
3 Key
£Digit3
pound
¢Digit4
cent
¤Digit4
currency
4Digit4
4 Key
%Digit5
percent
5Digit5
5 Key
Digit5
euro
Digit5
infinity
¼Digit6
one quarter
6Digit6
6 Key
§Digit6
section sign
&Digit7
and
½Digit7
half
7Digit7
7 Key
¾Digit8
three quarters
8Digit8
8 Key
Digit8
bullet
ªDigit9
feminine ordinal indicator
Digit9
inverted apostrophe
9Digit9
9 Key
(Digit9
parentheses left
:Period:
;Semicolonsemicolon (firefox)
<Backquote<
=Equalequals (firefox)
ßMinusß / ?
@@ (firefox)
aKeyAa
áKeyA
a acute
bKeyBb
KeyB
integral
©KeyC
copywright
cKeyCc
ðKeyD
voiced dental fricative
dKeyDd
KeyD
partial
éKeyE
e acute
DeadKeyEe
eKeyEe
fKeyFf
ƒKeyF
f with hook
gKeyGg
˙KeyH
overdot
˚KeyH
small degree
hKeyHh
DeadKeyIi
^KeyI
caret
iKeyIi
íKeyI
i acute
jKeyJj
KeyJ
delta
kKeyKk
°KeyK
degree
øKeyL
close mid front rounded vowel
lKeyLl
mKeyMm
µKeyM
one millionth
DeadKeyNn
ñKeyN
n with tilde
~KeyN
tilde
nKeyNn
óKeyO
o acute
oKeyOo
πKeyP
pi
öKeyP
o with umlaut
pKeyPp
qKeyQq
œKeyQ
open mid front rounded vowel
äKeyQ
open central unrounded vowel
rKeyRr
®KeyR
registered trademark
ßKeyS
sharp s
sKeySs
KeyT
obelus
tKeyTt
þKeyT
thorn
¨KeyU
umlaut
DeadKeyUu
úKeyU
u acute
uKeyUu
KeyV
sqaure root
vKeyVv
KeyW
summation sigma
åKeyW
open mid back unrounded vowel
ΣKeyW
sigma
wKeyWw
KeyX
approximate
xKeyXx
¥KeyY
yen
üKeyY
u with umlaut
yKeyYy
zKeyZz
ΩKeyZ
ohm
æKeyZ
near open front unrounded vowel
MetaMetaLeft
Windows Key / Left ⌘ / Chromebook Search key
MetaMetaRight
Right Windows
ContextMenuContextMenu
Windows Menu / Right ⌘
Standby
sleep
0Numpad0
Number Pad 0
1Numpad1
Number Pad 1
2Numpad2
Number Pad 2
3Numpad3
Number Pad 3
4Numpad4
Number Pad 4
5Numpad5
Number Pad 5
6Numpad6
Number Pad 6
7Numpad7
Number Pad 7
8Numpad8
Number Pad 8
9Numpad9
Number Pad 9
*NumpadMultiply
multiply
+NumpadAddadd
-NumpadSubtractsubtract
.NumpadDecimaldecimal point
/NumpadDivide
divide
F1F1f1
F2F2f2
F3F3f3
F4F4f4
F5F5f5
F6F6f6
F7F7f7
F8F8f8
F9F9f9
F10F10f10
F11F11f11
F12F12f12
F13F13f13
F14F14f14
F15F15f15
F16F16f16
F17F17f17
F18F18f18
F19F19f19
F20F20F20
F21F21F21
F22F22F22
F23F23F23
F24F24F24
F25F25F25
F26F26F26
F27F27F27
F28F28F28
F29F29F29
F30F30F30
F31F31F31
F32F32F32
NumLockNumLock
num lock
ScrollLockScrollLock
scroll lock
airplane mode
^BracketLeft^
DeadBracketRight!
؛ (arabic semicolon) / ¢
#Backquote#
$Backslash$
Quoteù
BrowserBackbrowser page backward
BrowserForwardbrowser page forward
BrowserRefreshbrowser refresh
)Minusclosing paren (AZERTY)
*Backslash*
+BracketRight~ + * key
|home key
-Minusminus (firefox)
AudioVolumeDowndecrease volume level
AudioVolumeUpincrease volume level
MediaTrackNextMediaTrackNextnext
MediaTrackPreviousMediaTrackPreviousprevious
MediaStopstop
MediaPlayPauseplay/pause
LaunchMail
e-mail
AudioVolumeMuteVolumeMutemute/unmute (firefox)
AudioVolumeDownVolumeDowndecrease volume level (firefox)
AudioVolumeUpVolumeUpincrease volume level (firefox)
Semicolon
ellipsis
;Semicolonsemi-colon / ñ
Semicolon
pilcrow
±Equal
plus minus
Equal
not equal
×Equal
multiply
=Equalequal sign
çComma
c cedilla
Comma
greater than or equal
-Minusdash
Minus
dash
_Minus
underscore
Period
less than or equal
.Periodperiod
>Period
greater than
/Slashforward slash / ç
¿Slash
inverted question mark
?Slash
question mark
÷Slash
division
DeadIntlBackslashBacktick / grave accent / ñ / æ / ö / § / ±
`BackquoteBacktick / grave accent / ñ / æ / ö / § / ±
/IntlRo?
.NumpadCommanumpad period (chrome)
«BracketLeft
left guillemet
[BracketLeftopen bracket
{BracketLeft
braces left
BracketLeft
right double quotation
BracketLeft
inverted double quotation
\Backslashback slash
¬Backslash
logical negation
]BracketRightclose bracket / å
}BracketRight
braces right
»BracketRight
right guillemet
,Quote,double quote
´Quote
accent
'Quotesingle quote / ø / ä
`Backquote`
MetaOSLeft
left or right ⌘ key (firefox)
AltGraphAltRight
altgr
\IntlBackslash< /git >
DeadBackquote
GNOME Compose Key
ç
XF86Forward / é
XF86Back / ê
non-conversion / ë
Alphanumericalphanumeric / ð
HiraganaKatakanahiragana/katakana / ò
ZenkakuHankakuhalf-width/full-width / ó
KanjiModekanji / ô
unlock track pad (Chrome/Edge) / û
WakeUpWakeUpWakeUp

Frequently Asked Questions

Common questions about JavaScript keyboard events and keyCodes

What is keyCode in JavaScript?

keyCode is a deprecated property of keyboard events that returns a numeric code representing the key that was pressed. For example, 13 for Enter, 27 for Escape, and 65 for the letter A. While still supported in browsers, it's recommended to use event.key or event.code instead.

Learn more about keyCode

Why is keyCode deprecated?

keyCode was deprecated because it's hard to read (numeric codes vs. names), inconsistent across browsers, doesn't support international keyboards well, and can't distinguish between left and right modifier keys. The modern event.key and event.code properties solve these problems.

Read the full deprecation guide

What's the difference between keyCode, key, and code?

keyCode (deprecated) returns numeric values like 13 or 65. event.key returns the actual character or key name like 'Enter' or 'a'. event.code returns the physical key location like 'Enter' or 'KeyA', which doesn't change with keyboard layout.

See detailed comparison

How do I detect arrow keys in JavaScript?

Use event.key to detect arrow keys. For example: if (e.key === 'ArrowUp') { }. The arrow key values are 'ArrowUp', 'ArrowDown', 'ArrowLeft', and 'ArrowRight'. Legacy keyCodes are 37-40.

Complete arrow keys guide

Are keyCodes the same across browsers?

For common keys, yes, but there were historical inconsistencies, especially for special keys and international keyboards. This is one reason keyCode was deprecated. The modern event.key and event.code properties are standardized and consistent across all modern browsers.

Check browser compatibility

How do I detect Ctrl, Alt, and Shift keys?

Use the boolean properties e.ctrlKey, e.altKey, e.shiftKey, and e.metaKey to check if modifier keys are pressed during any keyboard event. For example: if (e.ctrlKey && e.key === 's') { } detects Ctrl+S.

Modifier keys guide

Should I use event.key or event.code?

Use event.key for most cases like text input and form handling. Use event.code for game controls or when you need to detect physical key position regardless of keyboard layout (like WASD keys).

When to use each property

How do I prevent arrow keys from scrolling the page?

Call e.preventDefault() in your keydown event handler when arrow keys are detected. For example: if (e.key.startsWith('Arrow')) { e.preventDefault(); }. Only do this when necessary, as users expect arrow keys to scroll.

See examples