Key Code Checker - JavaScript Keyboard Event Info
Instant keyboard event viewer. Press any key to see its Key Code, Code, and key value. Essential for debugging keyboard shortcuts and game controls.
⌨️
Press any key
Focus this window and start typing
Understanding JavaScript Keyboard Events
When web developers build interactive applications—like games, data entry forms, or accessibility tools—they rely on "Keyboard Events" to detect what the user is typing.
Key vs Code vs KeyCode
- event.key: Represents the character value. Pressing "A" yields "a" or "A" depending on Shift. This is preferred for handling text input.
- event.code: Represents the physical key on the keyboard. Pressing the key next to Caps Lock is always "KeyA", regardless of keyboard layout (QWERTY vs AZERTY). This is best for game controls (WASD).
- event.keyCode: An integer representing the key. While deprecated in modern standards, it is still widely used in legacy codebases (e.g., 13 for Enter, 27 for Escape).
Common Key Codes Reference
- Enter: 13
- Escape: 27
- Space: 32
- Left Arrow: 37
- Up Arrow: 38
- Right Arrow: 39
- Down Arrow: 40
Why use this tool?
Different browsers and operating systems can sometimes behave inconsistently, especially with modifier keys (Command vs Control) or function keys (F1-F12). This tool provides the raw truth of what the browser is actually receiving, helping you debug why your hotkeys aren't working.