Keycode / KeyboardEvent Inspector
Press any key to see event.key, event.code and legacy keyCode with location and modifier state — entirely on this device.
Not capturing — focus the field to start.
Esc ends capture — the Escape event is logged first, then capture stops. Tab moves focus on and ends capture — no key is blocked.
Virtual keyboards often report keyCode 229 for every key — when that happens, the card is derived from the typed text instead.
Event details
- event.key
- —
- event.code
- —
- event.keyCodedeprecated
- —
- event.whichdeprecated
- —
- location
- —
- repeat
- —
- modifiers
- —
Waiting for a key press — values fill in live.
—Event log
| Type | Key | Code | keyCode | Location | Modifiers |
|---|---|---|---|---|---|
| No events yet — press a key in the capture field above. | |||||
Key reference table
All 120 keys with their event.key, event.code and legacy keyCode values for an unmodified press on a US layout — layout differences and browser divergences are called out in the notes.
All 120 keys shown
No matching key — here's how keyCodes work
The filter matches key names and aliases, event.code values, and plain numbers, which search the legacy keyCode space (0–255) only.
| Key | event.key | event.code | keyCodedeprecated | Location | Notes |
|---|---|---|---|---|---|
| Enterediting | Enter | Enter | 13 | 0 — Standard | The classic legacy value: keyCode 13, ASCII carriage return. Modern handlers should test e.key === "Enter" instead of the number. The numeric keypad's Enter shares key "Enter" and keyCode 13 — only code ("NumpadEnter") and location 3 tell the two apart. |
| Backspaceediting | Backspace | Backspace | 8 | 0 — Standard | keyCode 8 is ASCII backspace. Browsers once treated it as history-back outside text fields; modern ones have retired that default. |
| Deleteediting | Delete | Delete | 46 | 0 — Standard | Deletes forward. Compact Mac keyboards produce it with Fn+⌫, and the keypad's decimal key reports Delete too when NumLock is off. |
| Insertediting | Insert | Insert | 45 | 0 — Standard | Toggles overtype mode in many editors. Apple keyboards omit the key entirely; Numpad0 stands in for it when NumLock is off. |
| Escapeother | Escape | Escape | 27 | 0 — Standard | keyCode 27 = ASCII ESC. The browser acts on it too: it exits fullscreen and closes native dialogs before a page can object. Legacy IE reported key "Esc"; every modern engine says "Escape". |
| Context Menuother | ContextMenu | ContextMenu | 93 | 0 — Standard | The right-click-menu key found on Windows keyboards. Chrome on macOS also reports keyCode 93 for the right Command key — never branch on 93 alone. |
| Print Screenother | PrintScreen | PrintScreen | 44 | 0 — Standard | On Windows the OS screenshot service swallows the keydown — pages typically observe only the keyup event. |
| Pauseother | Pause | Pause | 19 | 0 — Standard | A mainframe-era survivor, rare on laptops. A plain press is keyCode 19; with Control held, many browsers report 3 (Break) instead. |
| Tabnavigation | Tab | Tab | 9 | 0 — Standard | keyCode 9 = ASCII horizontal tab. keydown fires first, then the browser moves focus — a page must call preventDefault() to keep focus in place. |
| Arrow Upnavigation | ArrowUp | ArrowUp | 38 | 0 — Standard | The legacy arrow block runs 37–40: left, up, right, down. With NumLock off, Numpad8 reports the same "ArrowUp"/38 pair from location 3. |
| Arrow Downnavigation | ArrowDown | ArrowDown | 40 | 0 — Standard | Arrows scroll the page by default, so games and editors call preventDefault(). Numpad2 doubles as ArrowDown when NumLock is off. |
| Arrow Leftnavigation | ArrowLeft | ArrowLeft | 37 | 0 — Standard | keyCode 37 opens the arrow block. Old IE called this key "Left"; the standard value is "ArrowLeft". Numpad4 mirrors it with NumLock off. |
| Arrow Rightnavigation | ArrowRight | ArrowRight | 39 | 0 — Standard | Reported as "Right" by legacy IE and "ArrowRight" everywhere today. Numpad6 mirrors it when NumLock is off. |
| Homenavigation | Home | Home | 36 | 0 — Standard | Jumps to the start of a line or document. Numpad7 reports Home when NumLock is off; Mac laptops emulate it with Fn+ArrowLeft. |
| Endnavigation | End | End | 35 | 0 — Standard | The counterpart to Home, keyCode 35. Numpad1 produces End with NumLock off; on Mac laptops it lives on Fn+ArrowRight. |
| Page Upnavigation | PageUp | PageUp | 33 | 0 — Standard | Scrolls one viewport up, keyCode 33. Numpad9 stands in with NumLock off; Mac laptops map it to Fn+ArrowUp. |
| Page Downnavigation | PageDown | PageDown | 34 | 0 — Standard | Scrolls one viewport down, keyCode 34. Numpad3 stands in with NumLock off; Mac laptops map it to Fn+ArrowDown. |
| Shift (left)modifier | Shift | ShiftLeft | 16 | 1 — Left | Both Shift keys share key "Shift" and keyCode 16 — location 1 and code "ShiftLeft" are what identify this one. |
| Shift (right)modifier | Shift | ShiftRight | 16 | 2 — Right | Indistinguishable from the left Shift by key or keyCode alone; check e.code ("ShiftRight") or e.location (2 = right side). |
| Control (left)modifier | Control | ControlLeft | 17 | 1 — Left | keyCode 17 for either Control key; while held, every event's ctrlKey flag is true — the usual way chords are detected. On Windows, AltGr layouts synthesize a ControlLeft press alongside the right Alt — a Control event you never typed. |
| Control (right)modifier | Control | ControlRight | 17 | 2 — Right | The mirror of ControlLeft: same key "Control" and keyCode 17, distinguished only by code and location 2. |
| Alt / Option (left)modifier | Alt | AltLeft | 18 | 1 — Left | Alt on Windows, Option (⌥) on macOS — same key "Alt", keyCode 18. Windows treats a lone Alt tap as a menu-bar shortcut, so focus can leave the page on keyup. |
| Alt / AltGr (right)modifier | Alt | AltRight | 18 | 2 — Right | On layouts with AltGr this key reports key "AltGraph" instead of "Alt", and Windows pairs it with a synthesized ControlLeft press. |
| Meta (left)modifier | Meta | MetaLeft | 91 | 1 — Left | The Windows key / ⌘ Command, keyCode 91 in modern browsers (ancient Firefox used 224). The OS owns most Meta chords — ⌘Q, ⌘Tab, Win+L — so many of them never reach the page at all. |
| Meta (right)modifier | Meta | MetaRight | 92 | 2 — Right | Usually keyCode 92 (the right Windows key), but Chrome on macOS reports 93 for the right ⌘ — one more reason keyCode is deprecated. |
| Caps Lockmodifier | CapsLock | CapsLock | 20 | 0 — Standard | Read the lock state with getModifierState("CapsLock"). macOS fires keydown when the lock turns on but only keyup when it turns off. |
| Num Lockmodifier | NumLock | NumLock | 144 | 0 — Standard | Toggles the keypad between digits and navigation — the reason Numpad8 can arrive as ArrowUp. Apple keyboards replace it with Clear. |
| Scroll Lockmodifier | ScrollLock | ScrollLock | 145 | 0 — Standard | Nearly vestigial — Excel still honors it for arrow-key scrolling, and many compact keyboards omit the key entirely. |
| F1function | F1 | F1 | 112 | 0 — Standard | The F row runs keyCode 112–123 in order — among the few keys whose legacy numbers never varied by browser. Windows browsers historically opened Help on F1. |
| F2function | F2 | F2 | 113 | 0 — Standard | Rename in Windows Explorer and edit-cell in Excel; it reaches web pages reliably on every platform. |
| F3function | F3 | F3 | 114 | 0 — Standard | Browsers bind Find Next to F3; a page that wants it must call preventDefault() on keydown. |
| F4function | F4 | F4 | 115 | 0 — Standard | Alt+F4 closes the window at the OS level — a reserved chord no web page can intercept. |
| F5function | F5 | F5 | 116 | 0 — Standard | Reload. The keydown does reach the page first, so editors and kiosks may preventDefault() to keep unsaved work. |
| F6function | F6 | F6 | 117 | 0 — Standard | Moves focus between browser panes — page, address bar, toolbars — a keyboard-accessibility workhorse. |
| F7function | F7 | F7 | 118 | 0 — Standard | Firefox toggles caret browsing with F7; other browsers pass it straight through to the page. |
| F8function | F8 | F8 | 119 | 0 — Standard | No major browser claims F8 by default — pages receive it untouched, which is why debuggers love it. |
| F9function | F9 | F9 | 120 | 0 — Standard | Free of browser defaults; desktop suites use it heavily (recalculate in Excel, send/receive in Outlook). |
| F10function | F10 | F10 | 121 | 0 — Standard | Focuses the menu bar on Windows, and Shift+F10 opens the context menu — both can act before your handler runs. |
| F11function | F11 | F11 | 122 | 0 — Standard | The fullscreen toggle. Desktop browsers typically consume it themselves, so this key may never reach the page — the canonical reserved-key example. |
| F12function | F12 | F12 | 123 | 0 — Standard | Opens DevTools in every desktop browser; pages rarely see it at all. |
| Spacealphanumeric | | Space | 32 | 0 — Standard | e.key is a literal single space character — easy to misread in logs, which is why tables label it. keyCode 32 = ASCII space. Its default action scrolls the page (or activates a focused button), so game and media pages preventDefault() it. |
| 0alphanumeric | 0 | Digit0 | 48 | 0 — Standard | Top-row zero, keyCode 48 (ASCII "0"); shifted it types ) on US layouts. The keypad's zero is a different key: code Numpad0, keyCode 96. |
| 1alphanumeric | 1 | Digit1 | 49 | 0 — Standard | The top row simply maps to ASCII: keyCode 48 + digit. Shifted, this key types ! on US layouts. |
| 2alphanumeric | 2 | Digit2 | 50 | 0 — Standard | On AZERTY the unshifted press types é, yet code stays "Digit2" — key follows the layout while code follows the physical position. |
| 3alphanumeric | 3 | Digit3 | 51 | 0 — Standard | keyCode 51. Shifted it types # on US keyboards but £ on UK ones — another value that only e.key reports faithfully. |
| 4alphanumeric | 4 | Digit4 | 52 | 0 — Standard | keyCode 52; Shift turns it into $ on US layouts. Hold it down and watch the repeat flag switch on. |
| 5alphanumeric | 5 | Digit5 | 53 | 0 — Standard | keyCode 53 from the top row. The keypad's 5 reports keyCode 101 (Numpad5) with NumLock on — same printed digit, different key. |
| 6alphanumeric | 6 | Digit6 | 54 | 0 — Standard | keyCode 54; the shifted value is ^ on US layouts, a dead-key circumflex on several European ones. |
| 7alphanumeric | 7 | Digit7 | 55 | 0 — Standard | keyCode 55, shifted to & on US layouts. On AZERTY the unshifted press types è instead of a digit. |
| 8alphanumeric | 8 | Digit8 | 56 | 0 — Standard | keyCode 56, shifted to * on US layouts — which is why old code testing for the asterisk on 56 broke on other keyboards. |
| 9alphanumeric | 9 | Digit9 | 57 | 0 — Standard | keyCode 57 closes the ASCII digit run 48–57; Shift types ( on US layouts. |
| Aalphanumeric | a | KeyA | 65 | 0 — Standard | Letters report the ASCII code of the UPPERCASE letter — 65 — whatever the case typed. On AZERTY this physical position types q while code stays "KeyA". |
| Balphanumeric | b | KeyB | 66 | 0 — Standard | keyCode 66. Editors listen for ⌘/Ctrl+B (bold); the letter itself arrives as key "b" or "B" depending on Shift and Caps Lock. |
| Calphanumeric | c | KeyC | 67 | 0 — Standard | keyCode 67, home of the copy chord ⌘/Ctrl+C. The chord fires a normal keydown with ctrlKey or metaKey set — copy itself is a separate clipboard event. |
| Dalphanumeric | d | KeyD | 68 | 0 — Standard | keyCode 68. Browsers claim ⌘/Ctrl+D for bookmarking, so pages usually cannot repurpose that chord. |
| Ealphanumeric | e | KeyE | 69 | 0 — Standard | keyCode 69. The most frequent letter in English text — a favorite for testing auto-repeat and rollover. |
| Falphanumeric | f | KeyF | 70 | 0 — Standard | keyCode 70. ⌘/Ctrl+F opens the browser's find bar; pages that override it (code editors do) must preventDefault(). |
| Galphanumeric | g | KeyG | 71 | 0 — Standard | keyCode 71; ⌘/Ctrl+G steps through find results in most browsers. |
| Halphanumeric | h | KeyH | 72 | 0 — Standard | keyCode 72. In terminals Ctrl+H is ASCII backspace — a reminder that control chords predate the web by decades. |
| Ialphanumeric | i | KeyI | 73 | 0 — Standard | keyCode 73; ⌘/Ctrl+Shift+I opens DevTools, one of the chords a page never receives. |
| Jalphanumeric | j | KeyJ | 74 | 0 — Standard | keyCode 74. Ctrl+J historically meant line feed (ASCII 10) in terminals; browsers use the chord for the downloads panel. |
| Kalphanumeric | k | KeyK | 75 | 0 — Standard | keyCode 75. ⌘/Ctrl+K focuses the search or address bar in many apps and browsers, so treat that chord as taken. |
| Lalphanumeric | l | KeyL | 76 | 0 — Standard | keyCode 76; ⌘/Ctrl+L jumps to the address bar — a browser-owned chord on every platform. |
| Malphanumeric | m | KeyM | 77 | 0 — Standard | keyCode 77. On AZERTY the letter m lives on the physical key US layouts call Semicolon — e.code exposes exactly that. |
| Nalphanumeric | n | KeyN | 78 | 0 — Standard | keyCode 78; ⌘/Ctrl+N (new window) is handled by the browser chrome and rarely observable from a page. |
| Oalphanumeric | o | KeyO | 79 | 0 — Standard | keyCode 79. ⌘/Ctrl+O opens the file dialog unless the page prevents it on keydown. |
| Palphanumeric | p | KeyP | 80 | 0 — Standard | keyCode 80; ⌘/Ctrl+P prints. Web apps that hijack it for command palettes must preventDefault() before keyup. |
| Qalphanumeric | q | KeyQ | 81 | 0 — Standard | keyCode 81. ⌘Q quits the browser on macOS before any event fires — the textbook chord a page never sees. AZERTY swaps this position with A. |
| Ralphanumeric | r | KeyR | 82 | 0 — Standard | keyCode 82; ⌘/Ctrl+R reloads. The keydown reaches the page first, so editors with unsaved state can intercept it. |
| Salphanumeric | s | KeyS | 83 | 0 — Standard | keyCode 83. ⌘/Ctrl+S triggers the browser's save dialog unless prevented — the classic first shortcut every web editor overrides. |
| Talphanumeric | t | KeyT | 84 | 0 — Standard | keyCode 84; ⌘/Ctrl+T opens a new tab at the browser level, out of any page's reach. |
| Ualphanumeric | u | KeyU | 85 | 0 — Standard | keyCode 85. Ctrl+U shows page source in most browsers; on macOS it is free for pages. |
| Valphanumeric | v | KeyV | 86 | 0 — Standard | keyCode 86, the paste chord ⌘/Ctrl+V. The keydown carries only the letter — pasted text arrives via the separate paste event. |
| Walphanumeric | w | KeyW | 87 | 0 — Standard | keyCode 87. ⌘/Ctrl+W closes the tab and most browsers refuse to let pages prevent it. AZERTY swaps this position with Z. |
| Xalphanumeric | x | KeyX | 88 | 0 — Standard | keyCode 88, the cut chord ⌘/Ctrl+X; like copy and paste, the clipboard work happens in a separate event. |
| Yalphanumeric | y | KeyY | 89 | 0 — Standard | keyCode 89; redo on Windows (Ctrl+Y). German QWERTZ swaps this position with Z — e.code "KeyY" still names the US position. |
| Zalphanumeric | z | KeyZ | 90 | 0 — Standard | keyCode 90 ends the letter run 65–90. ⌘/Ctrl+Z is undo; QWERTZ types y here and AZERTY types w — three layouts, one code. |
| Semicolonalphanumeric | ; | Semicolon | 186 | 0 — Standard | Chromium and Safari report 186 but Firefox reports 59 — the poster child for cross-browser keyCode drift. e.code "Semicolon" is stable everywhere. |
| Equalsalphanumeric | = | Equal | 187 | 0 — Standard | 187 in Chromium, 61 in Firefox. On German layouts this physical key hosts the ´ dead key — press it there and key becomes "Dead". |
| Commaalphanumeric | , | Comma | 188 | 0 — Standard | keyCode 188 in every modern browser; shifted it types < on US layouts. |
| Minusalphanumeric | - | Minus | 189 | 0 — Standard | 189 in Chromium — but Firefox reports 173, the very number Chromium uses for volume-mute. Never branch on this keyCode. |
| Periodalphanumeric | . | Period | 190 | 0 — Standard | keyCode 190; shifted it types > on US layouts. The keypad's decimal point is a separate key (NumpadDecimal, 110). |
| Slashalphanumeric | / | Slash | 191 | 0 — Standard | keyCode 191 across browsers. A favorite single-key shortcut — search boxes on many sites focus when / is pressed. |
| Backquotealphanumeric | ` | Backquote | 192 | 0 — Standard | keyCode 192. Grave doubles as a dead key on many international layouts, and games bind consoles to the physical position via e.code regardless of layout. |
| Left Bracketalphanumeric | [ | BracketLeft | 219 | 0 — Standard | keyCode 219; shifted it types {. On German layouts this physical key carries ü — key follows the layout. |
| Backslashalphanumeric | \ | Backslash | 220 | 0 — Standard | keyCode 220, shifted to |. ISO keyboards shrink this key and add IntlBackslash next to the left Shift instead. |
| Right Bracketalphanumeric | ] | BracketRight | 221 | 0 — Standard | keyCode 221, shifted to }. Like the whole OEM punctuation block (186–222), the number was never standardized — only e.code is. |
| Quotealphanumeric | ' | Quote | 222 | 0 — Standard | On a German layout this position types ä — key reports "ä" while code stays "Quote", the clearest demonstration that key follows layout and code follows the physical key. keyCode 222 in every modern browser; shifted it types " on US layouts. |
| ISO Extra Keyalphanumeric | < | IntlBackslash | 226 | 0 — Standard | The 102nd key on ISO (European) keyboards, squeezed beside the left Shift; keyCode 226. Its printed characters vary by layout — German boards type < and > here. |
| Numpad 0numpad | 0 | Numpad0 | 96 | 3 — Numpad | The keypad block runs keyCode 96–105, right after the letters. With NumLock off this key turns into Insert (keyCode 45). |
| Numpad 1numpad | 1 | Numpad1 | 97 | 3 — Numpad | keyCode 97 with NumLock on; with it off the same key reports End (keyCode 35). |
| Numpad 2numpad | 2 | Numpad2 | 98 | 3 — Numpad | keyCode 98, or ArrowDown (40) when NumLock is off — code "Numpad2" stays constant either way. |
| Numpad 3numpad | 3 | Numpad3 | 99 | 3 — Numpad | keyCode 99 with NumLock on; PageDown (34) with it off. |
| Numpad 4numpad | 4 | Numpad4 | 100 | 3 — Numpad | keyCode 100, or ArrowLeft (37) when NumLock is off. |
| Numpad 5numpad | 5 | Numpad5 | 101 | 3 — Numpad | keyCode 101 with NumLock on. With it off the center key reports the obscure "Clear" value, keyCode 12. |
| Numpad 6numpad | 6 | Numpad6 | 102 | 3 — Numpad | keyCode 102, or ArrowRight (39) when NumLock is off. |
| Numpad 7numpad | 7 | Numpad7 | 103 | 3 — Numpad | keyCode 103 with NumLock on; Home (36) with it off. |
| Numpad 8numpad | 8 | Numpad8 | 104 | 3 — Numpad | keyCode 104 with NumLock on. With it off the browser reports key "ArrowUp" and keyCode 38 while code stays "Numpad8" — the classic NumLock confusion. |
| Numpad 9numpad | 9 | Numpad9 | 105 | 3 — Numpad | keyCode 105 with NumLock on; PageUp (33) with it off. |
| Numpad *numpad | * | NumpadMultiply | 106 | 3 — Numpad | keyCode 106 — unaffected by NumLock, unlike the digit keys around it. |
| Numpad +numpad | + | NumpadAdd | 107 | 3 — Numpad | keyCode 107. The top-row + (Shift+Equal on US layouts) reports a completely different pair: code "Equal", keyCode 187. |
| Numpad -numpad | - | NumpadSubtract | 109 | 3 — Numpad | keyCode 109; 108 was reserved for a separator key most keyboards never shipped. |
| Numpad .numpad | . | NumpadDecimal | 110 | 3 — Numpad | keyCode 110 with NumLock on, Delete (46) with it off. Many European layouts type a comma from this key instead of a period. |
| Numpad /numpad | / | NumpadDivide | 111 | 3 — Numpad | keyCode 111 closes the keypad operator run 106–111; NumLock has no effect on it. |
| Numpad Enternumpad | Enter | NumpadEnter | 13 | 3 — Numpad | Same key "Enter" and keyCode 13 as the main Enter — code "NumpadEnter" and location 3 are the only honest discriminators. |
| Volume Mutemedia | AudioVolumeMute | AudioVolumeMute | 173 | 0 — Standard | 173 in Chromium — the same number Firefox uses for the Minus key; Firefox reports 181 here. The OS may consume volume keys before any browser event fires. |
| Volume Downmedia | AudioVolumeDown | AudioVolumeDown | 174 | 0 — Standard | keyCode 174 in Chromium, 182 in Firefox. Older specs named the key value "VolumeDown" without the Audio prefix. |
| Volume Upmedia | AudioVolumeUp | AudioVolumeUp | 175 | 0 — Standard | keyCode 175 in Chromium, 183 in Firefox — adjacent keys, adjacent drift. |
| Media Next Trackmedia | MediaTrackNext | MediaTrackNext | 176 | 0 — Standard | keyCode 176. On most systems the OS media service handles it and the browser exposes control through the Media Session API instead. |
| Media Previous Trackmedia | MediaTrackPrevious | MediaTrackPrevious | 177 | 0 — Standard | keyCode 177, the twin of MediaTrackNext — and just as likely to be claimed by the OS before a page sees it. |
| Media Stopmedia | MediaStop | MediaStop | 178 | 0 — Standard | keyCode 178; increasingly rare as a physical key since most media clusters collapsed to play/pause and track skip. |
| Media Play/Pausemedia | MediaPlayPause | MediaPlayPause | 179 | 0 — Standard | keyCode 179. Hardware players and the OS usually claim it first — pages integrate via the Media Session API rather than this event. |
| Browser Backmedia | BrowserBack | BrowserBack | 166 | 0 — Standard | keyCode 166, a dedicated navigation key on multimedia keyboards. The browser navigates immediately, so the page rarely survives to log it. |
| Browser Forwardmedia | BrowserForward | BrowserForward | 167 | 0 — Standard | keyCode 167; like BrowserBack, it triggers history navigation at the browser level rather than reaching page scripts. |
| Browser Refreshmedia | BrowserRefresh | BrowserRefresh | 168 | 0 — Standard | keyCode 168 — the hardware sibling of F5, and equally likely to reload before your handler finishes. |
| Browser Searchmedia | BrowserSearch | BrowserSearch | 170 | 0 — Standard | keyCode 170; opens the system or browser search UI on keyboards that still carry the key. |
| IME Processime | Process | (varies) | 229 | 0 — Standard | While an IME composes text, every keydown reports key "Process" and keyCode 229; the finished text arrives through input events, not keydown. There is no "Process" entry in the code registry — the code column varies with whichever physical key is being pressed, so this row shows "(varies)". |
| Dead Keyime | Dead | (varies by layout) | 229 | 0 — Standard | A dead key primes an accent and prints nothing: ´ then e yields é. key is "Dead" while code names whichever physical key hosts the accent on your layout. Chromium reports keyCode 229 for dead keys — the same placeholder IMEs use — which is why 229 answers two different mysteries. |
| Convert (変換)ime | Convert | Convert | 28 | 0 — Standard | The henkan key on Japanese keyboards, asking the IME to convert the current kana; keyCode 28. |
| NonConvert (無変換)ime | NonConvert | NonConvert | 29 | 0 — Standard | The muhenkan companion that declines conversion and keeps the kana as typed; keyCode 29. |
Do it offline:$ showkey -a
How to use it
- Click or tap into the labeled capture box — it is a real input, so keyboards, switch devices and screen readers all activate it the same way — then press the key you are curious about.
- Read the card: key and code side by side, keyCode and which wearing their deprecated badges, then location, modifiers and repeat. Advisory chips explain anything unusual in the engine's own words.
- Copy what the job needs — Copy as JSON for the exact snapshot, Copy snippet for a modern event.key handler, Copy link when a table key is showing. Esc ends capture and is logged first.
- No hardware keyboard? Type in the text field instead. To look a key up without pressing it, search the table below by name, code value or keyCode number — press / to focus the filter.
Click the capture box and press any key: event.key, event.code, the deprecated keyCode and which, location and modifier flags appear instantly, with a copyable JSON snapshot and handler snippet. Every keydown and keyup lands in the log, and the full key table below is plain HTML — searchable by name, code or number, readable before any script loads. Nothing you press leaves this page.
How it works
The UI Events specification gives every keyboard event two identities. event.key is the logical result of the press — the character or named action the active layout produces. event.code names the physical position (Semicolon, KeyZ, Numpad8) and never changes when the layout does. Match on code for position-based controls like WASD; match on key when what the user typed is what matters.
keyCode and which predate the standard: numeric ids the first browsers invented, mutually compatible only for common keys — punctuation values famously diverged between engines. UI Events lists both as legacy and deprecated, yet browsers still populate them and old handlers still read them, so this page shows the live numbers wearing a deprecated badge instead of pretending they are gone.
Three smaller fields complete the picture. location separates twins that share a key value: 0 is the standard block, 1 and 2 are left and right modifiers, 3 is the numeric keypad. The four modifier flags report whether Alt, Ctrl, Meta or Shift was down when the event fired. repeat marks the auto-repeat train a held key generates.
Capture is honest about its limits. Listening starts only while the labeled box has focus, and the page never calls preventDefault, so Tab still moves on and browser shortcuts keep working. Keys the OS or browser reserves — F11, ⌘Q, media keys — may act immediately or never reach the page. During IME composition browsers report keyCode 229 and the real text arrives later through input events. The laptop Fn layer is handled in hardware and produces no event at all.
Examples
Enterkey "Enter" · code "Enter" · keyCode 13 (deprecated)
element.addEventListener('keydown', (e) => {
if (e.key === 'Enter') {
// One e.key, two physical keys: e.code is 'Enter' or 'NumpadEnter'.
handleKey(e); // your handler
}
});The most-asked legacy number: Enter is keyCode 13. The copyable snippet tests event.key, and its comment warns that the numeric keypad's Enter reports the same key with code NumpadEnter.
Shift (left)key "Shift" · code "ShiftLeft" · keyCode 16 (deprecated) · location 1 (left)Both Shift keys share key Shift and keyCode 16; code ShiftLeft and location 1 identify this one. Pressing Shift alone also raises its own shiftKey flag, so the card carries the reserved-chord advisory.
ä (German layout){
"type": "keydown",
"key": "ä",
"code": "Quote",
"keyCode": 222,
"which": 222,
"location": 0,
"altKey": false,
"ctrlKey": false,
"metaKey": false,
"shiftKey": false,
"repeat": false,
"isComposing": false
}Copy as JSON, byte for byte, for ä pressed on a German layout: key follows the layout while code still names the physical Quote position — the pair that makes layout bugs visible.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
Dead keys print nothing — on purpose
On layouts with accent keys, key arrives as "Dead" and no character appears: the press only primes the accent, and the composed letter (´ then e gives é) arrives with the next key. The card flags it, so an apparently broken key reads as composition.
IME composition reports keyCode 229
While an input method assembles text — and on many Android keyboards, for every single keystroke — keydown carries 229 instead of a real value. The committed characters travel through input events, which is what the text-field fallback card derives its values from.
Auto-repeat floods keydown, not keyup
Hold a key and the OS replays keydown with repeat: true until release; only then does a single keyup fire. The event log collapses the train into one ×n row, so a held key cannot scroll away the event you actually wanted to read.
NumLock turns the keypad into arrows
With NumLock off, Numpad 8 reports key ArrowUp and keyCode 38 while code stays Numpad8. Only the code column reveals the press came from the keypad — the classic source of haunted-arrow-keys bug reports.
Reserved chords may never arrive
Hold any modifier and the card warns you: the browser or OS owns some combinations (F11, ⌘Q, media keys) and can act on them before — or instead of — dispatching an event. An empty log after a shortcut is a finding here, not a failure.
The Fn layer is invisible to the DOM
Laptop Fn is processed in hardware: pressing Fn alone generates no event in most browsers, and an Fn-shifted action surfaces as whatever the firmware maps — sometimes nothing. No inspector can show an event that never reaches the browser.
Rollover order is visible in the log
Press several keys together and the log records the exact order the browser received them — keydowns as they landed, keyups as you released. When a shortcut library claims a chord fired out of order, this table is the arbiter.
Common errors
No matching key — here's how keyCodes work- The filter's no-match state, shown with a reminder of what the search understands: key names and aliases, event.code values, and plain numbers, which search the legacy keyCode space only. A digit query matching no row gets a teaching line, never an empty table.
A modifier is held. The browser or OS handles some chords and reserved keys itself (F11, ⌘Q, media keys), so this combination may act immediately — or never reach this page.- Appears on the card whenever any modifier flag is set — including a bare press of Shift, Ctrl, Alt or Meta, which raises its own flag. It is the honest reading of reserved shortcuts: this page never blocks them, so some chords act at the OS level first.
An input method is composing: browsers report keyCode 229 while an IME assembles text, so keydown does not carry the final character — it arrives in input events once composition commits.- Shown when keyCode is 229 or isComposing is true. Nothing is wrong with the keyboard: composition means the text is still being assembled, and the finished character never travels through keydown. Watch the following input events — or use the text field above on Android.
FAQ
What is the keycode for the Enter key?
13 — in every major browser, which is why so much legacy code tests it. New code should compare event.key === "Enter" instead; to tell the keypad's Enter apart, check event.code for NumpadEnter.
What is the difference between event.key and event.code?
key reports what the press produced under the active layout; code reports which physical key moved. On a German layout the key beside your return key says ä in key and Quote in code. Position-based shortcuts want code; text handling wants key.
Why does my keyboard event show keyCode 229?
229 is the composition placeholder: an IME is still building the text when keydown fires, so the browser sends the reserved value instead of guessing. Several Android keyboards report it for every keystroke. The finished characters arrive in input events once composition commits.
Is keyCode deprecated?
Yes. UI Events defines keyCode and which as legacy attributes, kept only so old pages keep working, and steers new code toward key and code. This inspector still displays both, badged, because debugging often means reading handlers written fifteen years ago.
Why does F11 or Cmd+Q never show up in the log?
Because the browser or operating system consumed it. Fullscreen, quit, tab switching and media control are handled above the page, which may see the event after the action has happened — or not at all. This page deliberately never calls preventDefault to fight for them.
Why does my numeric keypad type arrow keys?
NumLock is off, so the keypad sends its navigation meanings: Numpad 8 becomes ArrowUp with keyCode 38, while event.code keeps reporting Numpad8. Toggle NumLock and the same key returns to the digit 8 with keyCode 104.
Can I inspect key codes in a terminal instead?
On Linux, showkey -a prints the ASCII values the kernel sees per press — useful for TTY work, but those are not DOM values and will not match event.key or event.code. macOS and Windows ship no showkey; for browser behaviour, test in the browser.
Keyboard shortcuts
- /
- Focus the key filter