JavaScript Keycode Inspector
Press any key to see its event.key, event.code, keyCode, which, location and modifier flags — a keycode.info-style JavaScript key inspector.
Tab is shown but still moves focus so you can leave the panel. Some browser shortcuts (F5, Ctrl+W…) cannot be captured.
Keys typed into a text box on the page stay in that box and are not read. On a button or link, Enter and Space still press it as well as being read.
Inspect any key's JavaScript event
Press any key — wherever the focus is on the page, with nothing to click first — 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.
Do I have to click the panel before pressing a key?
No. The page listens for keys wherever the focus is, so a key is read even while a button has the focus. Two exceptions are stated under the panel: a key typed into a text box on the page stays in that box, and on a button or link Enter and Space are read but still press it. The status dot shows whether keys are reaching the page at all — if another window has the focus, click the page to resume.