Keycode Finder
Press any key to see its event.key, event.code, keyCode, location and modifiers, with a ready JavaScript snippet to listen for it.
How to find a key code
Click the box
So keys such as Space do not scroll the page.
Press a key
See its key, code, keyCode and modifiers.
Copy the snippet
Use the JavaScript to listen for that key.
When to use Keycode Finder
You are adding keyboard shortcuts and need the exact key or code value a key sends.
A shortcut works on your keyboard but not on a colleague's, and you suspect a layout difference.
Tips for a better Keycode Finder result
Hold the modifier keys before pressing the main key to see the combination and get a snippet that checks it.
Test with the keyboard layouts your users have; event.key changes with layout while event.code stays the same.
Keycode Finder: limits and what to check
Some combinations, such as Ctrl+W or Cmd+Q, are taken by the browser or system and never reach the page.
Phones with on-screen keyboards often report Unidentified or 229 for every key, so test shortcuts on a real keyboard.
About Keycode Finder
Find the values a key press sends to JavaScript. event.key is what the key means (it changes with keyboard layout and Shift), event.code is the physical key (it does not), and keyCode is the old number still found in older code. Location tells left from right modifiers and the number pad.
FAQs
Which property should I use?
event.key for shortcuts and text, event.code for games and controls that depend on position.
Why does keyCode show 229?
An input method editor (for Chinese, Japanese and similar input) is active and the key has not been resolved yet.
Can it detect the Fn key?
No. Fn is handled by the keyboard itself and never reaches the browser.