Skip to main content

JavaScript Keycode Info

Press any key to see its JavaScript event.key, event.code and keyCode, with a ready-to-use snippet and a searchable key list. Private.

Press a key

On a phone or tablet

On-screen keyboards report limited values: key may be "Unidentified" and keyCode 229.

Common keys

keycodekeyCodeNote
aKeyA65with Shift the key is "A"
bKeyB66with Shift the key is "B"
cKeyC67with Shift the key is "C"
dKeyD68with Shift the key is "D"
eKeyE69with Shift the key is "E"
fKeyF70with Shift the key is "F"
gKeyG71with Shift the key is "G"
hKeyH72with Shift the key is "H"
iKeyI73with Shift the key is "I"
jKeyJ74with Shift the key is "J"
kKeyK75with Shift the key is "K"
lKeyL76with Shift the key is "L"
mKeyM77with Shift the key is "M"
nKeyN78with Shift the key is "N"
oKeyO79with Shift the key is "O"
pKeyP80with Shift the key is "P"
qKeyQ81with Shift the key is "Q"
rKeyR82with Shift the key is "R"
sKeyS83with Shift the key is "S"
tKeyT84with Shift the key is "T"
uKeyU85with Shift the key is "U"
vKeyV86with Shift the key is "V"
wKeyW87with Shift the key is "W"
xKeyX88with Shift the key is "X"
yKeyY89with Shift the key is "Y"
zKeyZ90with Shift the key is "Z"
0Digit048
1Digit149
2Digit250
3Digit351
4Digit452
5Digit553
6Digit654
7Digit755
8Digit856
9Digit957
EnterEnter13the main Enter key
EnterNumpadEnter13numpad Enter: location 3
BackspaceBackspace8
DeleteDelete46
TabTab9
EscapeEscape27
SpaceSpace32event.key is a single space
InsertInsert45
ArrowLeftArrowLeft37
ArrowUpArrowUp38
ArrowRightArrowRight39
ArrowDownArrowDown40
HomeHome36
EndEnd35
PageUpPageUp33
PageDownPageDown34
ShiftShiftLeft16location 1 (left)
ShiftShiftRight16location 2 (right)
ControlControlLeft17location 1 (left)
ControlControlRight17location 2 (right)
AltAltLeft18location 1 (left)
AltAltRight18location 2 (right)
MetaMetaLeft91Windows or Command key
MetaMetaRight92Windows or Command key
CapsLockCapsLock20
ContextMenuContextMenu93
;Semicolon186
=Equal187
,Comma188
-Minus189
.Period190
/Slash191
`Backquote192
[BracketLeft219
\Backslash220
]BracketRight221
'Quote222
AudioVolumeMuteAudioVolumeMute173
AudioVolumeDownAudioVolumeDown174
AudioVolumeUpAudioVolumeUp175
MediaTrackNextMediaTrackNext176
MediaTrackPreviousMediaTrackPrevious177
MediaPlayPauseMediaPlayPause179
F1F1112
F2F2113
F3F3114
F4F4115
F5F5116
F6F6117
F7F7118
F8F8119
F9F9120
F10F10121
F11F11122
F12F12123
0Numpad096location 3 (numpad)
1Numpad197location 3 (numpad)
2Numpad298location 3 (numpad)
3Numpad399location 3 (numpad)
4Numpad4100location 3 (numpad)
5Numpad5101location 3 (numpad)
6Numpad6102location 3 (numpad)
7Numpad7103location 3 (numpad)
8Numpad8104location 3 (numpad)
9Numpad9105location 3 (numpad)
*NumpadMultiply106location 3 (numpad)
+NumpadAdd107location 3 (numpad)
-NumpadSubtract109location 3 (numpad)
.NumpadDecimal110location 3 (numpad)
/NumpadDivide111location 3 (numpad)
NumLockNumLock144

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Free JavaScript Keycode and event.key Finder

Press any key to see what JavaScript reports for it: event.key, event.code, the old keyCode and which side of the keyboard it is on. A snippet is ready to copy. It gives developers a quick browser-based way to solve a focused javascript keycode info task before moving the result into a project.

How to use it

Click the box below and press a key. The big letter is event.key. The last ten presses are listed. Below, search the list of common keys.

Common mistakes

  • Using keyCode in new code: it is deprecated. Use event.key or event.code.
  • Comparing event.key with a lower-case letter while Shift or Caps Lock is on: "A" is not "a".

Frequently asked questions

What is the keycode for Enter in JavaScript?
event.key is "Enter" and event.code is "Enter" (or "NumpadEnter" on the numpad). The old keyCode is 13. Use event.key in new code.
Why is keyCode marked deprecated?
keyCode and which are legacy values that differ between keyboards and browsers. event.key (what the key means) and event.code (which physical key) are the modern, reliable choices.
What is the difference between key and code?
key is the character or action, for example "a" or "A" with Shift. code is the physical key, such as "KeyA", and does not change with the keyboard layout or Shift.
Why do I see "Unidentified" on my phone?
Virtual keyboards report limited values. Use the text box on this page to see what your keyboard sends through beforeinput.
Is anything I type sent anywhere?
No. Keys are read in your browser and are never stored or uploaded.
How do I use this javascript keycode info tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Frontend & Design

View all Frontend & Design tools →