UTILS.
Private by default
⌨

Keyboard Event Tester

See the key, code and keyCode for any key you press, with modifier flags.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →
Click here, then press any key

About this tool

Click the box and press any key to inspect the JavaScript keyboard event — key, code, keyCode, which and modifier states — live in your browser.

The tool listens for keydown on the box only, so click the box first, then press any key. It shows event.key, event.code, the legacy keyCode and which numbers, and yes or no for Ctrl, Alt, Shift and Meta. A modifier pressed alone is reported like any other key.

While the box has focus, any key that is not a single plain character has its default browser action blocked, so arrows, function keys and anything held with Ctrl, Alt or Meta can be inspected without scrolling or triggering a shortcut. Ordinary typing, Tab and Escape are left alone, so the keyboard can always leave the box. Nothing is stored or sent.

Frequently asked questions

Why doesn't anything happen?
Click inside the box first so it has focus, then press a key to capture the event.
Are keyCode and which deprecated?
Yes — they are legacy properties; prefer event.key and event.code in new code.
Can I Tab out of the box?
Yes. Tab and Escape keep their normal action, so the keyboard can always leave the box. Their key details are still shown before focus moves.
Does it show key releases?
No. Only keydown is handled, so nothing changes when you release a key.

More tools