Keyboard Event Tester
See key, code, keyCode and modifiers for any keypress.
How to use
- 1 Click the capture box to give it focus.
- 2 Press any key or key combination.
- 3 Read the reported key, code, keyCode, location and modifiers.
- 4 Copy the formatted details if you need them elsewhere.
About Keyboard Event Tester
The Keyboard Event Tester shows you exactly what your browser reports when you press a key.
Click the capture box and hit any key or combination, and the tool displays the live values of event.key, event.code, the legacy keyCode, the physical key location, which modifier keys were held, and whether the press was an auto-repeat.
It is the fastest way to answer questions that come up constantly when wiring up keyboard shortcuts or building games and editors.
The distinction between key and code trips up a lot of developers: event.key is the character produced (which changes with layout and Shift), while event.code identifies the physical key regardless of layout.
Seeing both side by side makes the difference obvious.
The tool also resolves the numeric location into a readable label — Standard, Left, Right or Numpad — so you can tell a numpad Enter from the main one, or a left Shift from a right Shift.
A formatted combo string like "Ctrl + Shift + A" is shown front and centre and can be copied along with the full event detail, which is handy when you want to document a shortcut or paste the values into a bug report.
Everything is captured locally in your browser; no keystrokes are ever transmitted or logged anywhere.
FAQ
What is the difference between event.key and event.code?
event.key is the character produced and depends on layout and modifiers, while event.code identifies the physical key on the keyboard regardless of layout.
Why is keyCode shown if it is deprecated?
keyCode is legacy but still appears in older code and tutorials, so it is included for reference alongside the modern key and code values.
Are my keystrokes recorded anywhere?
No. Every keypress is processed locally in your browser and nothing is sent to a server or stored.