Keyboard Key Code Tester
Press any key to see its JavaScript key, code and keyCode, and check every key on your keyboard works.
Press any key on your keyboard…
- event.key
- —
- event.code
- —
- event.keyCode
- —
- Location
- —
- Repeating
- —
- Keys tested
- 0
- Ctrl
- Alt
- Shift
- Meta
Tested keys
No keys tested yet. Press every key you want to check — each one shows up here once.
Key log
| key | code | keyCode | Location | Modifiers |
|---|
The last 50 key presses will be listed here, newest first.
How it works
Press any key and this keyboard tester shows exactly what your browser received:
the printable event.key, the physical event.code (which does
not change with your keyboard layout), the legacy event.keyCode, the key
location (left, right or numpad) and which modifiers were held. Every unique key you
press is added to the “Tested keys” list, so you can walk across the whole keyboard
and instantly spot a dead, stuck or double-typing key — a key that never appears is a
key the computer never saw.
The log keeps the last 50 presses and can be copied or downloaded as a CSV for a repair ticket or a bug report. Everything runs in your browser with plain JavaScript keyboard events: no keystroke is uploaded, logged on a server or stored after you close the tab. Tick “Block browser shortcuts” if you also want to test keys that the browser would normally swallow, such as Tab, Space or Ctrl+S.
Frequently asked questions
How do I test if my keyboard keys are working?
Click anywhere on the page and press every key you want to check. Each key you press is added to the "Tested keys" list and to the key log, so you can walk across the whole keyboard and see at a glance which keys never showed up — those are the dead ones. A key that fires twice from one press shows up as two log rows, which is how you spot a double-typing (chattering) key. If a key is blocked by the browser instead of your keyboard, tick "Block browser shortcuts while testing" and try again.
What is the difference between event.key, event.code and keyCode?
event.key is the character or name the key produces right now — it changes with your layout and with Shift, so the same physical key can report "a" or "A" or "q" on AZERTY. event.code identifies the physical key on the keyboard (KeyA, ShiftLeft, Numpad5) and never changes with layout, which makes it the right choice for game controls and shortcuts. event.keyCode is the legacy numeric code (65 for A); it is deprecated but still handy when debugging older code. This tester shows all three at once for every press.
Why is my key not registering in the keyboard tester?
Three common reasons: the key is genuinely dead or the keyboard is disconnected; the browser or operating system swallowed it before the page saw it (Tab, F5, Alt+F4, Cmd+Space and similar) — turn on "Block browser shortcuts while testing" to catch most of those; or you are using an on-screen or IME keyboard, which reports an "Unidentified" key with keyCode 229 instead of the real key. The tool tells you when that happens. Media and Fn keys are often handled in hardware and never reach the browser at all.