Free developer tool

JavaScript Keycode Finder

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.keyevent.codeLegacy keyCodeLocation
BackspaceBackspace8Standard (0)
TabTab9Standard (0)
EnterEnter13Standard (0)
EnterNumpadEnter13Numpad (3)
ShiftShiftLeft16Left (1)
ShiftShiftRight16Right (2)
ControlControlLeft17Left (1)
ControlControlRight17Right (2)
AltAltLeft18Left (1)
AltAltRight18Right (2)
PausePause19Standard (0)
CapsLockCapsLock20Standard (0)
EscapeEscape27Standard (0)
SpaceSpace32Standard (0)
PageUpPageUp33Standard (0)
PageDownPageDown34Standard (0)
EndEnd35Standard (0)
HomeHome36Standard (0)
ArrowLeftArrowLeft37Standard (0)
ArrowUpArrowUp38Standard (0)
ArrowRightArrowRight39Standard (0)
ArrowDownArrowDown40Standard (0)
PrintScreenPrintScreen44Standard (0)
InsertInsert45Standard (0)
DeleteDelete46Standard (0)
0Digit048Standard (0)
1Digit149Standard (0)
2Digit250Standard (0)
3Digit351Standard (0)
4Digit452Standard (0)
5Digit553Standard (0)
6Digit654Standard (0)
7Digit755Standard (0)
8Digit856Standard (0)
9Digit957Standard (0)
aKeyA65Standard (0)
bKeyB66Standard (0)
cKeyC67Standard (0)
dKeyD68Standard (0)
eKeyE69Standard (0)
fKeyF70Standard (0)
gKeyG71Standard (0)
hKeyH72Standard (0)
iKeyI73Standard (0)
jKeyJ74Standard (0)
kKeyK75Standard (0)
lKeyL76Standard (0)
mKeyM77Standard (0)
nKeyN78Standard (0)
oKeyO79Standard (0)
pKeyP80Standard (0)
qKeyQ81Standard (0)
rKeyR82Standard (0)
sKeyS83Standard (0)
tKeyT84Standard (0)
uKeyU85Standard (0)
vKeyV86Standard (0)
wKeyW87Standard (0)
xKeyX88Standard (0)
yKeyY89Standard (0)
zKeyZ90Standard (0)
MetaMetaLeft91Left (1)
MetaMetaRight92Right (2)
ContextMenuContextMenu93Standard (0)
0Numpad096Numpad (3)
1Numpad197Numpad (3)
2Numpad298Numpad (3)
3Numpad399Numpad (3)
4Numpad4100Numpad (3)
5Numpad5101Numpad (3)
6Numpad6102Numpad (3)
7Numpad7103Numpad (3)
8Numpad8104Numpad (3)
9Numpad9105Numpad (3)
*NumpadMultiply106Numpad (3)
+NumpadAdd107Numpad (3)
-NumpadSubtract109Numpad (3)
.NumpadDecimal110Numpad (3)
/NumpadDivide111Numpad (3)
F1F1112Standard (0)
F2F2113Standard (0)
F3F3114Standard (0)
F4F4115Standard (0)
F5F5116Standard (0)
F6F6117Standard (0)
F7F7118Standard (0)
F8F8119Standard (0)
F9F9120Standard (0)
F10F10121Standard (0)
F11F11122Standard (0)
F12F12123Standard (0)
F13F13124Standard (0)
F14F14125Standard (0)
F15F15126Standard (0)
F16F16127Standard (0)
F17F17128Standard (0)
F18F18129Standard (0)
F19F19130Standard (0)
F20F20131Standard (0)
F21F21132Standard (0)
F22F22133Standard (0)
F23F23134Standard (0)
F24F24135Standard (0)
NumLockNumLock144Numpad (3)
ScrollLockScrollLock145Standard (0)
;Semicolon186Standard (0)
=Equal187Standard (0)
,Comma188Standard (0)
-Minus189Standard (0)
.Period190Standard (0)
/Slash191Standard (0)
`Backquote192Standard (0)
[BracketLeft219Standard (0)
\Backslash220Standard (0)
]BracketRight221Standard (0)
'Quote222Standard (0)
\IntlBackslash226Standard (0)

How to inspect JavaScript keyboard events

  1. 1. Focus the capture area

    Click the labeled capture area or reach it with Tab.

  2. 2. Press a key or combination

    Inspect the values reported by your browser, or try a clearly labeled example.

  3. 3. Choose a matching strategy

    Choose code for physical position or key for the logical key, then copy the exact modifier-aware condition.

  4. 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.

Reference: MDN event.key, event.code and deprecated keyCode.

Automate repeatable development work

Tornic turns repeatable tasks into deterministic workflows for the AI coding CLIs you already use.

Explore Tornic

Related free tools