Keycode Info
Press any key to instantly see its key name, code, keyCode, and modifier state - useful for building and debugging keyboard shortcuts.
Press any key
Recommended Settings
Pro Tips
- •'code' identifies the physical key position and never changes with keyboard layout, while 'key' reflects the actual character produced, which does change with layout
- •'keyCode' and 'which' are legacy, deprecated properties still widely supported for backward compatibility, but 'code' and 'key' are the modern standard
- •The location value distinguishes duplicate keys, like Left Shift vs Right Shift, or a numpad key vs its main-keyboard equivalent
- •Modifier keys (Ctrl, Shift, Alt, Meta) are detected even when held alongside another key, useful for testing multi-key shortcuts
Most Popular
Most developers use this to look up the exact 'code' value needed to detect a specific physical key in a keyboard shortcut handler
When to Use This Tool
Find the exact key code needed to detect a specific keyboard shortcut in your code.
Check how a browser reports a key's event properties to diagnose inconsistent shortcut behavior.
Discover the code for a media key, function key, or other less common key.
Demonstrate the difference between key, code, and legacy keyCode properties.
How It Works
Listen for keydown events on the page while it has focus
Read the key, code, keyCode, which, location, and modifier properties from each event
Display the most recently pressed key's full event details
100% Private
Files never leave your device. All processing happens locally in your browser.
Lightning Fast
Powered by Client-side KeyboardEvent API for optimal performance on modern browsers.
Open Source
Built with verified, open-source libraries. Fully transparent.
Frequently Asked Questions
Why are keyCode and which marked deprecated?
Both properties are officially deprecated in the web standards in favor of 'key' and 'code', though browsers still support them for compatibility with older code.
What's the difference between 'key' and 'code'?
'code' represents the physical key position and stays constant regardless of keyboard layout, while 'key' represents the actual character or action produced, which can vary by layout, language, and Shift state.
Why doesn't my browser's shortcut (like Ctrl+W) show up here?
Browsers intercept and reserve many shortcuts for their own use (closing tabs, opening dev tools, etc.) before a page's JavaScript ever sees the keydown event.
Is my keyboard input sent anywhere?
No. Key events are captured and displayed entirely within your browser and are never transmitted anywhere.