What is a keyboard event tester?
A keyboard event tester shows the information a web browser receives when you press a key. Developers use it to write keyboard shortcuts and game controls correctly, and anyone can use it to check that a keyboard works before buying, after spilling something, or when a key seems dead.
Press a key to see event.key, event.code, the legacy keyCode, its location and active modifiers, plus whether it's auto-repeating. An on-screen keyboard highlights keys while held and marks each one that has worked, and an event log lists recent key presses and releases.
How to use the Keyboard event tester
1.Press any key
Its key, code and other values appear instantly.
2.Watch the keyboard
Keys light up while held and turn green once tested.
3.Read the log
The last 30 key down and up events are listed.
Example: one key, two values
Pressing Shift and 2 on a US keyboard:
- event.key
- "@"
- event.code
- Digit2
- Modifiers
- Shift
A shortcut bound to code Digit2 works on every layout; one bound to "@" depends on the layout.
key versus code
event.key is the character or action produced, which depends on the keyboard layout and Shift: on a US layout Shift+2 gives "@". event.code is the physical key's position, "Digit2", whatever the layout. Use key for typed text and code for game controls and position-based shortcuts.
keyCode is deprecated but still common in older code. location tells left from right Shift, Ctrl and Alt, and number-pad keys from the main row. Blocking browser shortcuts lets you test keys like F5 and Ctrl+S without the browser acting on them.
Frequently asked questions
Why doesn't a key register?
Some keys, like Fn or certain media keys, are handled by the system and never reach the browser.
Why is the Windows key shown as Meta?
Browsers report Windows and Command keys as Meta.
Is anything I type recorded?
No. Presses are shown on this page and nowhere else.
Does it work with non-US layouts?
Yes. event.key follows your layout; the on-screen keyboard shows US positions.
Related tools
What is my browser
See your browser, OS, screen size, pixel ratio, time zone and supported features.
ASCII table
All 128 ASCII characters with decimal, hex, octal, binary and HTML codes.
Typing Speed Test
Measure your typing speed in WPM and accuracy in 30 seconds to 2 minutes.
Regex Tester
Test JavaScript regular expressions with live highlighting, groups and replace.
Text Diff Checker
Compare two texts by line, word or character and see what changed.
Cron Expression Explainer
Translate a cron schedule into plain English and see its next run times.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator