Skip to content

Keyboard Keycodes

Embed

Paste this where you want Keyboard Keycodes on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/keyboard-keycodes/" width="100%" height="500" frameborder="0" loading="lazy" title="Keyboard Keycodes"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/keyboard-keycodes/">Keyboard Keycodes</a> by BrowserUtils</p>

Press any key to see its keyCode, key, and code values.Runs in this tab.

Press any key to see its properties
Click here first if not focused
Common Key Codes Reference
13Enter
9Tab
27Escape
32Space
8Backspace
46Delete
38ArrowUp
40ArrowDown
37ArrowLeft
39ArrowRight
16Shift
17Control
18Alt
91Meta
20CapsLock
112F1
113F2
114F3
115F4
116F5
117F6
118F7
119F8
120F9
121F10
122F11
123F12
36Home
35End
33PageUp
34PageDown
45Insert

Next step

About Keyboard Keycodes

Free online keyboard keycode tester. Press any key to instantly see its JavaScript keyCode, key, code, and which values. Essential for keyboard event handling. It runs in your browser. Nothing is sent to a server.

Questions

What is the difference between keyCode, key, and code?
keyCode is a deprecated numeric value for the key. key returns the character value (e.g., "a", "Enter"). code returns the physical key identifier (e.g., "KeyA", "Enter") regardless of keyboard layout. Use key or code instead of keyCode in modern code.
Why is keyCode deprecated?
keyCode is deprecated because its values are inconsistent across browsers and keyboard layouts. The key and code properties provide more reliable and descriptive values for handling keyboard events.
How do I detect modifier keys like Ctrl or Shift with this tool?
Press the modifier key and the tool will display its key, code, and keyCode values. Keyboard events also include boolean properties (ctrlKey, shiftKey, altKey, metaKey) that indicate which modifiers were held during a key press.
Does this keyboard keycode tool send any data to a server?
No. All key detection runs entirely in your browser using JavaScript event listeners. No keystrokes are recorded, transmitted, or stored anywhere.
What is the difference between keydown, keypress, and keyup events?
keydown fires when a key is pressed and repeats if held. keyup fires when the key is released. keypress is deprecated and only fired for character keys. Use keydown for most keyboard handling in modern applications.

More in Developer Reference

All 18 developer reference