JavaScript Key Code Inspector
Press any key and see the event.key, event.code, deprecated keyCode, location and modifiers the browser reports, with a history of recent presses.
Free · No sign-up · Your inputs stay in your browser
Input
See what a key press reports
Press any key. Clicks into a text field are ignored.
Output
Waiting for a key
Use event.key for what the key means (it follows the keyboard layout: 'z' on a German keyboard is where 'y' is on a US one) and event.code for its physical position (WASD in games). keyCode and which are deprecated and differ between browsers; they are shown because old code still reads them.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
key or code
event.key is what the key means under the current layout: 'z', 'Z', 'Enter', 'ArrowUp'. event.code is the physical key, named after its position on a US keyboard: 'KeyZ' on a German keyboard is where the Y is printed. Shortcuts and text input want key; games using WASD want code. The values are defined in the UI Events KeyboardEvent key values and code values specifications.
keyCode is deprecated
keyCode and which are numeric, layout-dependent and inconsistent between browsers. They still work and older code relies on them, which is why they are shown here, but new code should not.