Keyboard Keycodes
Press any key to see its keyCode, key, and code values.Runs in this tab.⌘ ↵ runs it
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
AtriumKitFrom the team behind browserutils
Turn a click-through into an interactive demo
AtriumKit records your web app once in Chrome and turns every click into a step of a demo you can embed or share. There’s a free plan.
Try AtriumKit freeAbout 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.
Comments
More in Developer Reference
- ASCII Table
- HTML Entities Reference
- Regex Cheatsheet
- CSS Selectors Reference
- HTML Color Names
- Unicode Table
- HTML Tags Reference
- CSS Units Reference
Comments