Keyboard Keycode Event Inspector — Free
Runs 100% in your browser — your files never leave your device.
Keyboard shortcuts fail when code confuses a character with its physical key or ignores modifiers and location. Press any key to capture the real browser KeyboardEvent and inspect key, code, legacy keyCode, keyboard location, and Meta, Shift, Control, or Alt state.
How it works
- 1
Focus the page
- 2
Press the key to inspect
- 3
Copy any event field
About this tool
key versus code versus keyCode
The tool shows all three for any key you press: event.key is the character or action (a, Shift, Enter), event.code is the physical key (KeyA, ShiftLeft) independent of layout, and keyCode is the deprecated numeric legacy. Modern code should read key and code.
Why the distinction matters
Bindings that survive keyboard layouts use code — WASD movement works on AZERTY and QWERTY alike. Bindings that must follow the character use key — shortcuts written for Ctrl+S should trigger on any layout's S. Choosing the wrong one is how shortcuts break for half your users.
The debugging workflow
Press the key in question and read the live values. If nothing appears, the browser consumed the key before the page — some combinations never reach web pages (system shortcuts, browser reserved keys). Test the key alone before testing the combination.
Frequently asked questions
Which property should my code use?
event.key for character-dependent behavior (typing, search), event.code for physical bindings (games, media keys). Avoid keyCode — it is deprecated and inconsistent.
Why does event.key change with Shift?
key reports the produced character, so Shift+a is "A" not "a". code stays KeyA in both cases — that stability is its purpose.
Do all keys report both values?
Nearly — some legacy and media keys report sparse values. The tool shows exactly what your browser and platform produce for each press.