Event & KeyCode Inspector·Real-Time DOM Detection·1-Click Copy
JavaScript Key Identifier
Press any key on your keyboard to instantly inspect its event.code, event.key, keyCode, and modifier states.
Press any key
We'll show you everything your browser knows about it.
event.code vs event.key vs keyCode
Understand which property to use in your JavaScript event handlers.
event.code— Physical key layout positionPhysical identifier like 'KeyA', 'Space', 'ArrowUp'. Identical across QWERTY, AZERTY, and Dvorak. Best for games and keybindings.
event.key— Rendered Unicode characterThe character typed after modifiers ('a' -> 'A' with Shift, '4' -> '$'). Best for text inputs and typing software.
event.keyCode— Legacy numerical valueNumeric code (e.g. 65 for A). Deprecated but retained for backward compatibility with older libraries.
Mac vs Windows Modifier Map
| Action | Windows | Mac |
|---|---|---|
| Primary modifier | Ctrl | Cmd (Meta) |
| Secondary modifier | Alt | Option (Alt) |
| Context menu | ContextMenu | — |
| Line start/end | Home / End | Cmd + ← / → |
Common Key Codes Cheat Sheet
Space32
Enter13
Escape27
Backspace8
Tab9
Shift16
Frequently asked questions
Developer FAQ regarding keyboard events and JavaScript key properties.