Dev
JavaScript Keycode Finder
Keyboard Capture
Press any key to inspect keycode and modifier states in real time.
Press Any Key
This tool listens to keydown events locally in your browser.
Frequently Asked Questions
What is a JavaScript keycode?
A keycode is a numeric value representing a physical keyboard key in browser keyboard events. Event.keyCode and Event.which are legacy properties returning numbers (e.g. 65 for 'A'). Modern code uses Event.key (returns 'a' or 'A') and Event.code (returns physical key id like 'KeyA').
What is the difference between keyCode, key, and code?
keyCode/which: legacy numeric codes, layout-dependent (deprecated). key: the value produced by the key press ('a', 'A', 'Enter', 'ArrowUp') — layout and modifier aware. code: the physical key identifier ('KeyA', 'Enter') — layout independent. Modern code should use key and code; avoid keyCode.
Why are keyCode and charCode deprecated?
They are inconsistent across browsers, do not account for non-QWERTY keyboard layouts, and fail for many international characters and special keys. The key and code properties introduced in DOM Level 3 Events are standardized, consistent, and internationalization-friendly.