JavaScript Keycode Info
Press any key to see its JavaScript event.key, event.code and keyCode, with a ready-to-use snippet and a searchable key list. Private.
Press a key
On a phone or tablet
On-screen keyboards report limited values: key may be "Unidentified" and keyCode 229.
Common keys
| key | code | keyCode | Note |
|---|---|---|---|
| a | KeyA | 65 | with Shift the key is "A" |
| b | KeyB | 66 | with Shift the key is "B" |
| c | KeyC | 67 | with Shift the key is "C" |
| d | KeyD | 68 | with Shift the key is "D" |
| e | KeyE | 69 | with Shift the key is "E" |
| f | KeyF | 70 | with Shift the key is "F" |
| g | KeyG | 71 | with Shift the key is "G" |
| h | KeyH | 72 | with Shift the key is "H" |
| i | KeyI | 73 | with Shift the key is "I" |
| j | KeyJ | 74 | with Shift the key is "J" |
| k | KeyK | 75 | with Shift the key is "K" |
| l | KeyL | 76 | with Shift the key is "L" |
| m | KeyM | 77 | with Shift the key is "M" |
| n | KeyN | 78 | with Shift the key is "N" |
| o | KeyO | 79 | with Shift the key is "O" |
| p | KeyP | 80 | with Shift the key is "P" |
| q | KeyQ | 81 | with Shift the key is "Q" |
| r | KeyR | 82 | with Shift the key is "R" |
| s | KeyS | 83 | with Shift the key is "S" |
| t | KeyT | 84 | with Shift the key is "T" |
| u | KeyU | 85 | with Shift the key is "U" |
| v | KeyV | 86 | with Shift the key is "V" |
| w | KeyW | 87 | with Shift the key is "W" |
| x | KeyX | 88 | with Shift the key is "X" |
| y | KeyY | 89 | with Shift the key is "Y" |
| z | KeyZ | 90 | with Shift the key is "Z" |
| 0 | Digit0 | 48 | |
| 1 | Digit1 | 49 | |
| 2 | Digit2 | 50 | |
| 3 | Digit3 | 51 | |
| 4 | Digit4 | 52 | |
| 5 | Digit5 | 53 | |
| 6 | Digit6 | 54 | |
| 7 | Digit7 | 55 | |
| 8 | Digit8 | 56 | |
| 9 | Digit9 | 57 | |
| Enter | Enter | 13 | the main Enter key |
| Enter | NumpadEnter | 13 | numpad Enter: location 3 |
| Backspace | Backspace | 8 | |
| Delete | Delete | 46 | |
| Tab | Tab | 9 | |
| Escape | Escape | 27 | |
| Space | Space | 32 | event.key is a single space |
| Insert | Insert | 45 | |
| ArrowLeft | ArrowLeft | 37 | |
| ArrowUp | ArrowUp | 38 | |
| ArrowRight | ArrowRight | 39 | |
| ArrowDown | ArrowDown | 40 | |
| Home | Home | 36 | |
| End | End | 35 | |
| PageUp | PageUp | 33 | |
| PageDown | PageDown | 34 | |
| Shift | ShiftLeft | 16 | location 1 (left) |
| Shift | ShiftRight | 16 | location 2 (right) |
| Control | ControlLeft | 17 | location 1 (left) |
| Control | ControlRight | 17 | location 2 (right) |
| Alt | AltLeft | 18 | location 1 (left) |
| Alt | AltRight | 18 | location 2 (right) |
| Meta | MetaLeft | 91 | Windows or Command key |
| Meta | MetaRight | 92 | Windows or Command key |
| CapsLock | CapsLock | 20 | |
| ContextMenu | ContextMenu | 93 | |
| ; | Semicolon | 186 | |
| = | Equal | 187 | |
| , | Comma | 188 | |
| - | Minus | 189 | |
| . | Period | 190 | |
| / | Slash | 191 | |
| ` | Backquote | 192 | |
| [ | BracketLeft | 219 | |
| \ | Backslash | 220 | |
| ] | BracketRight | 221 | |
| ' | Quote | 222 | |
| AudioVolumeMute | AudioVolumeMute | 173 | |
| AudioVolumeDown | AudioVolumeDown | 174 | |
| AudioVolumeUp | AudioVolumeUp | 175 | |
| MediaTrackNext | MediaTrackNext | 176 | |
| MediaTrackPrevious | MediaTrackPrevious | 177 | |
| MediaPlayPause | MediaPlayPause | 179 | |
| F1 | F1 | 112 | |
| F2 | F2 | 113 | |
| F3 | F3 | 114 | |
| F4 | F4 | 115 | |
| F5 | F5 | 116 | |
| F6 | F6 | 117 | |
| F7 | F7 | 118 | |
| F8 | F8 | 119 | |
| F9 | F9 | 120 | |
| F10 | F10 | 121 | |
| F11 | F11 | 122 | |
| F12 | F12 | 123 | |
| 0 | Numpad0 | 96 | location 3 (numpad) |
| 1 | Numpad1 | 97 | location 3 (numpad) |
| 2 | Numpad2 | 98 | location 3 (numpad) |
| 3 | Numpad3 | 99 | location 3 (numpad) |
| 4 | Numpad4 | 100 | location 3 (numpad) |
| 5 | Numpad5 | 101 | location 3 (numpad) |
| 6 | Numpad6 | 102 | location 3 (numpad) |
| 7 | Numpad7 | 103 | location 3 (numpad) |
| 8 | Numpad8 | 104 | location 3 (numpad) |
| 9 | Numpad9 | 105 | location 3 (numpad) |
| * | NumpadMultiply | 106 | location 3 (numpad) |
| + | NumpadAdd | 107 | location 3 (numpad) |
| - | NumpadSubtract | 109 | location 3 (numpad) |
| . | NumpadDecimal | 110 | location 3 (numpad) |
| / | NumpadDivide | 111 | location 3 (numpad) |
| NumLock | NumLock | 144 |
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Free JavaScript Keycode and event.key Finder
Press any key to see what JavaScript reports for it: event.key, event.code, the old keyCode and which side of the keyboard it is on. A snippet is ready to copy. It gives developers a quick browser-based way to solve a focused javascript keycode info task before moving the result into a project.
How to use it
Click the box below and press a key. The big letter is event.key. The last ten presses are listed. Below, search the list of common keys.
Common mistakes
- Using keyCode in new code: it is deprecated. Use event.key or event.code.
- Comparing event.key with a lower-case letter while Shift or Caps Lock is on: "A" is not "a".
Frequently asked questions
What is the keycode for Enter in JavaScript?
event.key is "Enter" and event.code is "Enter" (or "NumpadEnter" on the numpad). The old keyCode is 13. Use event.key in new code.
Why is keyCode marked deprecated?
keyCode and which are legacy values that differ between keyboards and browsers. event.key (what the key means) and event.code (which physical key) are the modern, reliable choices.
What is the difference between key and code?
key is the character or action, for example "a" or "A" with Shift. code is the physical key, such as "KeyA", and does not change with the keyboard layout or Shift.
Why do I see "Unidentified" on my phone?
Virtual keyboards report limited values. Use the text box on this page to see what your keyboard sends through beforeinput.
Is anything I type sent anywhere?
No. Keys are read in your browser and are never stored or uploaded.
How do I use this javascript keycode info tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.
More Frontend & Design
User-Agent ParserSee which browser and device a visitor usesSVG OptimizerMake SVG images smallerColor ConverterConvert colours between HEX, RGB and HSLColor Blindness SimulatorSee how colour-blind people see your designCSS Effects GeneratorCreate gradients and shadows visuallyMeta Tag / Open Graph PreviewPreview how your page looks on Google and socialImage Resizer / CropperResize photos, including passport sizeBase64 Image ConverterTurn an image into text code, and back