Data lookups
Keyboard key codes
JavaScript key values, codes and the legacy keyCode numbers.
45 entries.
| Key | event.key | event.code | Legacy keyCode | Notes |
|---|---|---|---|---|
| Backspace | Backspace | Backspace | 8 | |
| Tab | Tab | Tab | 9 | |
| Enter | Enter | Enter | 13 | NumpadEnter on the number pad |
| Shift | Shift | ShiftLeft / ShiftRight | 16 | |
| Ctrl | Control | ControlLeft / ControlRight | 17 | |
| Alt | Alt | AltLeft / AltRight | 18 | AltGr reports AltRight |
| Pause | Pause | Pause | 19 | |
| Caps Lock | CapsLock | CapsLock | 20 | |
| Esc | Escape | Escape | 27 | |
| Space | Space | 32 | event.key is a single space | |
| Page Up | PageUp | PageUp | 33 | |
| Page Down | PageDown | PageDown | 34 | |
| End | End | End | 35 | |
| Home | Home | Home | 36 | |
| Arrow Left | ArrowLeft | ArrowLeft | 37 | |
| Arrow Up | ArrowUp | ArrowUp | 38 | |
| Arrow Right | ArrowRight | ArrowRight | 39 | |
| Arrow Down | ArrowDown | ArrowDown | 40 | |
| Insert | Insert | Insert | 45 | |
| Delete | Delete | Delete | 46 | |
| 0–9 (top row) | 0–9 | Digit0–Digit9 | 48–57 | |
| A–Z | a–z / A–Z | KeyA–KeyZ | 65–90 | event.key follows Shift and Caps Lock |
| Left Windows / Cmd | Meta | MetaLeft | 91 | |
| Right Windows / Cmd | Meta | MetaRight | 92 | |
| Context menu | ContextMenu | ContextMenu | 93 | |
| Numpad 0–9 | 0–9 | Numpad0–Numpad9 | 96–105 | |
| Numpad * | * | NumpadMultiply | 106 | |
| Numpad + | + | NumpadAdd | 107 | |
| Numpad - | - | NumpadSubtract | 109 | |
| Numpad . | . | NumpadDecimal | 110 | |
| Numpad / | / | NumpadDivide | 111 | |
| F1–F12 | F1–F12 | F1–F12 | 112–123 | |
| Num Lock | NumLock | NumLock | 144 | |
| Scroll Lock | ScrollLock | ScrollLock | 145 | |
| ; : | ; or : | Semicolon | 186 | Layout dependent |
| = + | = or + | Equal | 187 | |
| , < | , or < | Comma | 188 | |
| - _ | - or _ | Minus | 189 | |
| . > | . or > | Period | 190 | |
| / ? | / or ? | Slash | 191 | |
| ` ~ | ` or ~ | Backquote | 192 | |
| [ { | [ or { | BracketLeft | 219 | |
| \ | | \ or | | Backslash | 220 | |
| ] } | ] or } | BracketRight | 221 | |
| ' " | ' or " | Quote | 222 |
event.keyCode is deprecated — use event.key for the character and event.code for the physical key. event.code does not change with keyboard layout.