Keycode Finder
runs in your browserno sign-upfree
Press any key to see its JavaScript event.key, event.code and keyCode, with modifiers and a ready-to-copy key handler — plus a searchable key code table.
Press any key
You’ll see its key, code and keyCode — with modifiers like Ctrl and Shift, too.
Key code table
| Key | event.key | event.code | keyCode |
|---|---|---|---|
| Backspace | "Backspace" | Backspace | 8 |
| Tab | "Tab" | Tab | 9 |
| Enter | "Enter" | Enter | 13 |
| Shift | "Shift" | ShiftLeft / ShiftRight | 16 |
| Ctrl | "Control" | ControlLeft / ControlRight | 17 |
| Alt / Option | "Alt" | AltLeft / AltRight | 18 |
| Pause | "Pause" | Pause | 19 |
| Caps Lock | "CapsLock" | CapsLock | 20 |
| Escape | "Escape" | Escape | 27 |
| Space | " " | Space | 32 |
| 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 |
| Print Screen | "PrintScreen" | PrintScreen | 44 |
| Insert | "Insert" | Insert | 45 |
| Delete | "Delete" | Delete | 46 |
| 0 | "0" | Digit0 | 48 |
| 1 | "1" | Digit1 | 49 |
| 2 | "2" | Digit2 | 50 |
| 3 | "3" | Digit3 | 51 |
| 4 | "4" | Digit4 | 52 |
| 5 | "5" | Digit5 | 53 |
| 6 | "6" | Digit6 | 54 |
| 7 | "7" | Digit7 | 55 |
| 8 | "8" | Digit8 | 56 |
| 9 | "9" | Digit9 | 57 |
| A | "a" | KeyA | 65 |
| B | "b" | KeyB | 66 |
| C | "c" | KeyC | 67 |
| D | "d" | KeyD | 68 |
| E | "e" | KeyE | 69 |
| F | "f" | KeyF | 70 |
| G | "g" | KeyG | 71 |
| H | "h" | KeyH | 72 |
| I | "i" | KeyI | 73 |
| J | "j" | KeyJ | 74 |
| K | "k" | KeyK | 75 |
| L | "l" | KeyL | 76 |
| M | "m" | KeyM | 77 |
| N | "n" | KeyN | 78 |
| O | "o" | KeyO | 79 |
| P | "p" | KeyP | 80 |
| Q | "q" | KeyQ | 81 |
| R | "r" | KeyR | 82 |
| S | "s" | KeyS | 83 |
| T | "t" | KeyT | 84 |
| U | "u" | KeyU | 85 |
| V | "v" | KeyV | 86 |
| W | "w" | KeyW | 87 |
| X | "x" | KeyX | 88 |
| Y | "y" | KeyY | 89 |
| Z | "z" | KeyZ | 90 |
| Windows / ⌘ (left) | "Meta" | MetaLeft | 91 |
| Windows / ⌘ (right) | "Meta" | MetaRight | 92 |
| Context menu | "ContextMenu" | ContextMenu | 93 |
| Numpad 0 | "0" | Numpad0 | 96 |
| Numpad 1 | "1" | Numpad1 | 97 |
| Numpad 2 | "2" | Numpad2 | 98 |
| Numpad 3 | "3" | Numpad3 | 99 |
| Numpad 4 | "4" | Numpad4 | 100 |
| Numpad 5 | "5" | Numpad5 | 101 |
| Numpad 6 | "6" | Numpad6 | 102 |
| Numpad 7 | "7" | Numpad7 | 103 |
| Numpad 8 | "8" | Numpad8 | 104 |
| Numpad 9 | "9" | Numpad9 | 105 |
| Numpad * | "*" | NumpadMultiply | 106 |
| Numpad + | "+" | NumpadAdd | 107 |
| Numpad - | "-" | NumpadSubtract | 109 |
| Numpad . | "." | NumpadDecimal | 110 |
| Numpad / | "/" | NumpadDivide | 111 |
| F1 | "F1" | F1 | 112 |
| F2 | "F2" | F2 | 113 |
| F3 | "F3" | F3 | 114 |
| F4 | "F4" | F4 | 115 |
| F5 | "F5" | F5 | 116 |
| F6 | "F6" | F6 | 117 |
| F7 | "F7" | F7 | 118 |
| F8 | "F8" | F8 | 119 |
| F9 | "F9" | F9 | 120 |
| F10 | "F10" | F10 | 121 |
| F11 | "F11" | F11 | 122 |
| F12 | "F12" | F12 | 123 |
| Num Lock | "NumLock" | NumLock | 144 |
| Scroll Lock | "ScrollLock" | ScrollLock | 145 |
| Semicolon ; | ";" | Semicolon | 186 |
| Equals = | "=" | Equal | 187 |
| Comma , | "," | Comma | 188 |
| Minus - | "-" | Minus | 189 |
| Period . | "." | Period | 190 |
| Slash / | "/" | Slash | 191 |
| Backquote ` | "`" | Backquote | 192 |
| Bracket [ | "[" | BracketLeft | 219 |
| Backslash \ | "\\" | Backslash | 220 |
| Bracket ] | "]" | BracketRight | 221 |
| Quote ' | "'" | Quote | 222 |
100 of 100 keys · US layout — on other layouts, punctuation keys can give other characters and codes.
About this tool
Press any key and see exactly what a JavaScript keyboard event reports: event.key (the character or key name, such as "a", "A" or "Enter"), event.code (the physical key, such as "KeyA"), the old numeric keyCode and which, the key’s location (left or right Shift, numpad) and which modifiers were held. Copy any value, or copy a ready-made keydown handler. Below, a searchable table lists the key codes of every common key.
How to use
- Press any key on your keyboard (on a phone, tap the box to open the keyboard).
- Read or copy event.key, event.code and keyCode — hold Ctrl, Shift, Alt or ⌘ to see modifiers.
- Copy the JavaScript snippet, or search the table for a key you can’t press right now.
FAQ
Should I use event.key, event.code or keyCode?
Use event.key for what the user typed or meant (shortcuts like Ctrl+S, Enter to submit) — it respects the keyboard layout. Use event.code for physical positions, such as WASD game controls that should stay in place on AZERTY keyboards. keyCode and which are deprecated: they still work, but avoid them in new code.
What is the keycode for Enter, Escape or Space?
Enter is 13, Escape is 27 and Space is 32 (their event.key values are "Enter", "Escape" and " "). The arrow keys are 37–40, the letters 65–90 and F1–F12 are 112–123 — search the table for any other key.
Why does my phone show keyCode 229 or “Unidentified”?
Many on-screen keyboards (and input methods for languages like Chinese or Japanese) compose text before it is typed, so keydown reports 229 / "Unidentified". Listen for the input event instead when you need the typed character on mobile.
Why don’t some shortcuts show up?
The browser or operating system keeps some keys for itself — for example Ctrl/⌘+W, Ctrl/⌘+T or Alt+Tab — so a web page never receives them.