JavaScript Keycode Info — event.key, code & keyCode Inspector

Press any key to see its JavaScript event.key, event.code, keyCode, which, location and modifier flags — a keycode.info-style inspector, in your browser.

Press any key
Click this panel, then press any key on your keyboard.
Click to activate

Tab is shown but still moves focus so you can leave the panel. Some browser shortcuts (F5, Ctrl+W…) cannot be captured.

🔒 Runs entirely in your browser — no keystrokes are uploaded or logged.

Inspect any key's JavaScript event

Click the panel and press any key to see the exact properties a browser keydown event exposes: event.key (the value the key produces), event.code (the physical key, independent of layout), the legacy event.keyCode and event.which numbers, the key location (left, right, or numpad), and which modifier keys — Ctrl, Shift, Alt, Meta — were held. Copy the whole report with one click to drop into a bug report or a keyboard-shortcut handler, or use the copy button on any single row to take just that value — KeyA on its own, or 13 on its own.

key vs. code vs. keyCode

event.key is what the key means — a, A, Enter, or ArrowLeft — and it changes with Shift and keyboard layout. event.code is the physical key, like KeyA or Numpad1, and stays the same whatever the layout, which is why it is preferred for game controls and position-based shortcuts. event.keyCode and event.which are the old numeric codes; they are deprecated but still turn up in legacy code, so the inspector shows them next to a readable name (for example 13 → Enter).

Frequently asked questions

What is the difference between event.key and event.code?

event.key is the character or named value the key produces and changes with Shift and layout — pressing A gives "a" or "A". event.code identifies the physical key (KeyA, Numpad1) regardless of layout, so it is the better choice for position-based shortcuts and game controls.

Is keyCode still safe to use?

event.keyCode and event.which are deprecated. They still work in every current browser, but new code should use event.key or event.code. This tool shows keyCode so you can read and migrate older code, and it maps common numbers to a readable name.

Why does Tab or F5 behave oddly in the panel?

The panel suppresses most default actions so the reading stays clean, but it deliberately lets Tab move focus so keyboard users are not trapped, and some browser-level shortcuts such as F5 refresh or Ctrl+W close cannot be intercepted by any web page.

Are my keystrokes sent anywhere?

No. Everything runs locally in your browser with JavaScript. The keys you press are read by this tool's own code in your browser, which does not upload, store or log them.