Keycode Info
Press a key and get the browser event details developers use to understand keyboard input, including the modern key and code values plus legacy numeric codes.
KEYBOARD EVENT INSPECTOR
Press a key
Click the panel to focus it, then press any key. The page reads the event without submitting or storing it.
Focus the panel and press a key.
- key
- —
- code
- —
- keyCode
- —
- which
- —
- charCode
- —
- location
- —
- repeat
- —
- modifiers
- —
A QUICK WALKTHROUGH
How to use this tool
- Focus the event area and press any key, including modifier, function, arrow, or printable keys.
- Read the captured key, code, numeric codes, location, repeat, and modifier flags.
- Use the values in your keyboard handler, then press another key to replace the current result.
key and code answer different questions
event.key describes the value or action after keyboard layout and modifiers are applied, such as A or ?. event.code describes the physical key position, such as KeyA or Slash, and is usually stable across layouts. Use key for text or commands and code for physical shortcuts.
Legacy numbers are included for compatibility
keyCode, which, and charCode are deprecated browser properties. This page displays them because older applications and debugging sessions still expose them; new code should prefer key, code, and the modifier properties.
Capture stays in this browser
The page listens only while its event panel is focused. It does not record passwords, send keystrokes to a server, or keep a history. A browser or operating-system shortcut may be handled before the page receives it.
GOOD TO KNOW
Common questions
What is the difference between key and code?
key is the resulting character or named action, while code is the physical keyboard position. For example, Shift + A reports key A and code KeyA.
Should I use keyCode in new JavaScript?
No. keyCode, which, and charCode are deprecated. Prefer key, code, and the modifier properties, while using the numeric fields only when inspecting legacy behavior.
Why did a shortcut not appear?
Browser, operating-system, or assistive-technology shortcuts can be handled before the page receives a key event. Focus the event panel and try a key that is not reserved by the browser.