Keyboard shortcuts misbehave for subtle reasons: a layout that reports a different code, a modifier that is stuck, or a browser that reserves a combination before your page ever sees it. This tester shows exactly what the browser reports for each key you press: the key value, the physical code, and the state of the Ctrl, Shift, Alt, and Meta modifiers, with a count of events so far. Click anywhere on the page first to give it focus, then press keys and watch the readout update. Developers use it to debug shortcut handlers, to verify that a keydown listener fires at all, and to document the difference between key and code for international keyboards, where the two diverge in informative ways.
Quick Answer: Click on the page, press any key, and instantly see its key, code, and modifiers.
Free Online Tool
Keyboard Event Tester
Press a key — see exactly what the browser reports.
Click anywhere on this page first, then press keys. The readout below updates on every keydown.
How to Use the Keyboard Event Tester
- Click anywhere on this page to give it keyboard focus.
- Press any key, alone or with modifiers.
- Read the key, code, and modifier readout.
- Press more keys to compare their codes.
- Use the readout to debug shortcut handlers or document behaviour.
Key Features
- Live key, code, and modifier readout for every keypress.
- Distinguishes key value from physical code.
- Modifier state for Ctrl, Shift, Alt, and Meta.
- Event counter for repeated-key testing.
- Instant, free, and private with no data recorded.
Best Practices and Tips
- Key is what the key means, such as a, A, or Enter, while code is where the key physically sits, such as KeyA; layouts change the first, not the second.
- Modifier keys themselves generate events, so pressing Shift alone produces a readout with Shift marked.
- Holding a key down repeats the event, which the counter makes visible; games and editors usually need to handle repeats explicitly.
- Browser-reserved combinations, such as Ctrl+T, may never reach the page, which the absence of a readout will reveal.
- Test with the layout your users actually use; a code that is stable on one layout can surprise you on another.
Common Mistakes to Avoid
- Using key when you mean code, or vice versa, and breaking shortcuts on non-US layouts.
- Forgetting that modifier state is part of the event; Ctrl+S and S are different shortcuts.
- Assuming a key that does nothing in the tester is broken; the browser may have intercepted it first.
- Testing shortcuts without focus on the page, so no events arrive at all.
Frequently Asked Questions
What is the difference between key and code?
Key describes the character or function the key produces, which depends on layout and modifiers, while code describes the physical key position, which stays the same across layouts. For shortcut handling, code is usually the reliable choice, while key is the right choice for text input.
Why do some shortcuts not appear?
Because the browser or operating system intercepts certain combinations before the page sees them, such as new-tab or window-management shortcuts. The tester can only report events the page actually receives, which is itself useful debugging information.
What are the modifier keys?
Ctrl, Shift, Alt, and Meta (the Windows key or Command key) modify the meaning of other keys, and each event reports which of them were held down. Shortcut definitions are combinations of a main key plus zero or more modifiers.
Does holding a key repeat the event?
Yes, most systems repeat keydown events while a key is held, after an initial delay. The event counter in this tool shows repeats clearly, which matters when a handler should act once per press rather than once per repeat.
Is anything I type recorded or sent?
No. The readout is computed in your browser and displayed on the page, and nothing is stored or transmitted. You can safely press keys here without worrying about the data leaving your device.