Keyboard Event Viewer
Press any key and see the keyCode, key, code, which, and modifier state in real-time.
Press any key on your keyboard...
Press any key to begin capturing keyboard events.
Was this page helpful?
Related tools
About Keyboard Event Viewer
See the JavaScript keyboard event properties for any key you press — key, code, keyCode, and modifier flags. Essential when wiring up shortcuts and key handlers.
How to use
- Click into the tool and press any key or combination.
- Read the event.key, event.code, and keyCode values.
- Use the exact values in your event-handling code.
Frequently asked questions
- Should I use key or code?
- Use event.key for the character produced and event.code for the physical key, which is layout-independent.
- Why is keyCode shown if it is deprecated?
- keyCode is legacy but still appears in older code; the tool shows it for reference while recommending key/code.