JavaScript Keycode & Key Event Inspector
The problem: Front-end developers building keyboard navigation and shortcuts struggle to verify event.key vs event.code cross-platform values.
ASG Privacy VerifiedVerified
100% In-Browser Execution. Zero server uploads. Your data never leaves this tab — disconnect your internet and the tool keeps working.
JavaScript Keycode & Key Event Inspector: the complete guide
A JavaScript Keycode and Keyboard Event Inspector captures and displays real-time properties of every physical key pressed on your keyboard. Front-end developers creating accessible modal dialogs, custom shortcut managers (like Ctrl+K command palettes), game controls, and keyboard navigation need to inspect event.key, event.code, keyCode, which, location, and active modifier keys (Ctrl, Alt, Shift, Meta). This tool displays a high-contrast visual dashboard of key events and provides ready-to-copy event listener code.
event.key versus event.code
Modern web development distinguishes between physical key locations and translated character values. The event.code property represents the physical key pressed regardless of keyboard layout (e.g. 'KeyQ' on both QWERTY and AZERTY keyboards). The event.key property represents the resulting symbol printed, accounting for Shift and international layout modifiers (e.g. 'q', 'Q', or '@').
Why keyCode is Deprecated and What to Use Instead
Legacy web applications relied on event.keyCode (numeric values like 13 for Enter or 27 for Escape). While browsers maintain compatibility, the W3C has deprecated keyCode due to inconsistencies across operating systems and languages. Modern applications should use event.key === 'Enter' or event.code === 'Enter' for reliable cross-platform behavior.
Step by step: how to use Keycode Inspector
- 1
Press any key on your keyboard while on this tool page.
- 2
Watch the key code, character value, and event metadata update instantly.
- 3
Observe active modifier pills (Ctrl, Shift, Alt, Meta) highlight in real time.
- 4
Inspect the location attribute (standard, numpad, left/right modifier).
- 5
Copy individual properties (key, code, which) with the 1-click copy buttons.
- 6
Copy the generated addEventListener JavaScript snippet directly into your codebase.
Security & privacy
All keyboard event listeners run strictly in your local browser window. Keystrokes are never logged, tracked, or sent to any telemetry server.