⌨️ JavaScript Keycode Finder
Press any key to see its JavaScript event properties
Press a key
Click here first, then press any key
event.key
—
event.code
—
event.keyCode (deprecated)
—
event.which (deprecated)
—
event.location
—
Modifiers
—
Event History
FAQ
Which property should I use?
Use event.key for the character value and event.code for the physical key location. Avoid keyCode and which as they are deprecated.
What's the difference between key and code?
event.key gives the character produced (affected by Shift, layout). event.code gives the physical key position (same regardless of layout or modifiers).