What Key Am I Pressing?
Press any key and see its name, its code, the legacy keyCode number and whether it is the left, right or numpad version. Useful for worn keycaps, remapping, game binds and code.
| key | code | keyCode | location | modifiers |
|---|---|---|---|---|
| – | ||||
Press any key and the box below tells you what key you are pressing: its name, its code, the numeric keyCode and whether it is the left, right or numpad version. The big label is the key value, the line under it shows code, keyCode and location, and the table keeps your last 12 presses.
How to use the key press detector
- Click anywhere on the page, or tap the box, so it has keyboard focus.
- Press a key. The large label shows the key name; the line beneath shows code, keyCode and location. If you were holding Shift, Ctrl, Alt or Meta, a modifiers line lists them.
- Press more keys. Each one is added to the Recent presses table with the same five fields, newest at the top, up to 12 rows.
- Press Reset to clear the display and the table.
Holding a key down makes the operating system repeat it. Repeats update the big label but are not added to the table, so one long hold still occupies one row. Space, Tab, Backspace, the up and down arrows, the slash and the quote key are captured so that the page does not scroll, change focus or open the browser's quick-find box while you test. Keys pressed together with Ctrl or Cmd are passed through to the browser as normal shortcuts.
Key versus code: which one do you need?
The browser describes every press in two ways, and they answer different questions.
- key
- "a"
- code
- KeyA
The key left of S types a lowercase a.
- key
- "A"
- code
- KeyA
Same physical key, same code. Only the meaning changes.
- key
- "q"
- code
- KeyA
The same position types q in French. The code still says KeyA.
key is the meaning of the press on your current keyboard layout, with modifiers applied. Press the key labelled A and the key is "a"; hold Shift and it becomes "A"; switch to a German layout and the key next to L becomes "ö". Non-printing keys get descriptive names: Enter, Escape, ArrowLeft, Backspace, F5. Space is shown as the word Space on this page so it is visible.
code is the physical position of the key, named after its label on a US keyboard and independent of layout, language and Shift. The key left of S is KeyA on every keyboard in the world, even on an AZERTY keyboard where it types Q. The digit row is Digit1 to Digit0, the function keys are F1 to F12, duplicated keys have a side in the name (ShiftLeft, ControlRight), and the keypad uses Numpad1, NumpadAdd, NumpadEnter and so on.
| Question | Use | Example |
|---|---|---|
| What character will this type? | key | "a", "A", "ö", "?" |
| Which physical key is this, regardless of language? | code | KeyA, Digit1, Backquote |
| Is this the left or right Shift? | code, or location | ShiftLeft, ShiftRight |
| Is this Enter on the keypad? | code, or location | NumpadEnter, location numpad |
| What number does old code expect? | keyCode | 65, 13, 32 |
For game binds, remapping tools and anything that should feel the same on every layout, use code. For text handling, search shortcuts and anything that cares which letter the user meant, use key.
What keyCode is and why it is still shown
keyCode is the original way browsers reported keys: a single number per key, roughly matching the Windows virtual-key codes. It has been deprecated for years, and browsers recommend key or code instead, but it has never been removed because so much existing code depends on it. Tutorials, older game engines, form validation scripts and many plugins still compare against numbers, so people still look them up.
Common values, which are consistent across browsers:
| Key | keyCode | code |
|---|---|---|
| A to Z | 65 to 90 | KeyA to KeyZ |
| 0 to 9 (main row) | 48 to 57 | Digit0 to Digit9 |
| Numpad 0 to 9 | 96 to 105 | Numpad0 to Numpad9 |
| F1 to F12 | 112 to 123 | F1 to F12 |
| Enter | 13 | Enter or NumpadEnter |
| Space | 32 | Space |
| Escape | 27 | Escape |
| Backspace | 8 | Backspace |
| Tab | 9 | Tab |
| Shift, Ctrl, Alt | 16, 17, 18 | ShiftLeft and so on |
| Arrows (left, up, right, down) | 37, 38, 39, 40 | ArrowLeft, ArrowUp, ArrowRight, ArrowDown |
Punctuation is where keyCode falls apart. The semicolon key reports 186 in Chrome and Edge but 59 in Firefox, and the minus key is 189 in Chrome and 173 in Firefox. Letters also report the same keyCode whether Shift is held or not, so you cannot tell "a" from "A" by keyCode alone. If you are writing new code, read code or key and treat the keyCode shown here as a reference for whatever legacy script you are maintaining.
What location means
Several keys exist twice on a keyboard, and location tells you which copy was pressed. The browser reports it as a number; this page shows it as a word.
| Location | Meaning | Keys it applies to |
|---|---|---|
| standard | The only copy of this key | Letters, digits, F keys, most others |
| left | The left-hand copy | Shift, Ctrl, Alt, Windows or Cmd |
| right | The right-hand copy | Shift, Ctrl, Alt, Windows or Cmd |
| numpad | A key on the numeric keypad | Numpad digits, operators, NumpadEnter, Num Lock |
Location is most useful for Enter and the modifiers. The main Enter and the keypad Enter both have the key name Enter and the same keyCode, but their codes differ and the keypad one reports location numpad. Likewise the two Shift keys share key and keyCode and are only distinguished by code and location. If a game lets you bind only one Shift and you are not sure which one it is listening for, press each and compare.
Keypad digits are worth a note. With Num Lock on, Numpad7 has the key "7"; with Num Lock off, the same physical key has the key "Home", while the code stays Numpad7 and location stays numpad. The keypad test page covers that in detail.
Common reasons to check what key you are pressing
Remapping keys. Tools such as PowerToys Keyboard Manager on Windows and Karabiner-Elements on macOS identify keys by their physical position, which lines up with code. Press the key you want to remap, note the code, and look for it in the tool. For keys that have the wrong meaning after a language switch, compare key against code: if code is right and key is wrong, it is a layout setting, not a hardware fault.
Keys with worn-off labels. When the legend has rubbed off a keycap, press it here and read the key value. For a key that produces a symbol with Shift, press it both ways and both characters appear in the table.
Game binds. Games usually store binds by physical key, and their settings menus sometimes show the key under an unfamiliar name. If a bind refuses to register, press the key here to confirm the browser sees it at all and to see whether it is a left or right modifier or a numpad key that the game treats separately.
Writing code. JavaScript keyboard handlers receive the same event this page reads: KeyboardEvent with key, code, keyCode and location properties. Press the key you want to handle, copy the code value into your handler, and check the modifiers line to see which flags will be set. For keys like Dead, Unidentified or Process, the table shows exactly what your handler will receive on that layout.
Checking a keyboard before buying or after a spill. If one key types the wrong character, this page tells you whether the hardware is reporting the right position with the wrong meaning, which is a layout problem, or a different position entirely, which is a wiring or firmware problem. To check that every key registers, run the full keyboard test instead.
Keys that will not show up
The Fn key is handled inside the keyboard and never reaches the computer. On Windows, the Windows key opens the Start menu and Print Screen only reports on release, if at all. Media keys, brightness keys and a laptop's Fn combinations usually act on the system without producing a key event the page can read. The lock keys do register: Caps Lock, Num Lock and Scroll Lock each report a code, although macOS only sends Caps Lock on press and not on release. If a key you expect to see stays silent, try it in a text editor first; if it works there and not here, it is one of the system-handled keys above rather than a broken switch.
Related keyboard tests
This page shows one press at a time in full detail. To check that every key on the keyboard registers, use the keyboard test on the home page, which maps each press to a diagram of your layout. If several keys pressed together are not all showing up, the keyboard ghosting test shows which keys in a chord arrive and which are dropped. And if a key seems to arrive late rather than wrong, the keyboard latency test measures reaction time so you can compare two keyboards.
Frequently asked questions
How do I find out what key I am pressing?
Click on this page and press the key. The large label shows the key's name, and the line under it shows its code, keyCode and location. The last 12 presses stay in the table below so you can press several keys in a row and read them back.
What is the difference between key and code?
The key is what the press means: the character it types or the action it performs, such as a, A, Enter or ArrowUp. The code is the physical key position, such as KeyA or Digit1, and does not change with Shift or the keyboard language. Press the same key with Shift and the key changes while the code stays the same.
Is keyCode still used?
keyCode is deprecated and browsers recommend key or code instead, but it still works and a lot of older code, tutorials and game engines rely on it. It is a number: 65 for A, 13 for Enter, 32 for Space, 27 for Escape. Values for punctuation keys can differ between browsers, which is one reason it was replaced.
What does location mean?
Location tells you which copy of a duplicated key you pressed. Standard is any key with only one copy, left and right distinguish the two Shift, Ctrl, Alt and Windows or Cmd keys, and numpad means the key is on the numeric keypad, so numpad Enter and the main Enter can be told apart even though both have the key name Enter.
Why does my key show as Dead or Unidentified?
Dead means the key is an accent key on your layout that waits for the next letter before producing a character, common on European layouts. Unidentified means the browser received a key event it could not map to a known name, which happens with some media, macro or vendor-specific keys. In both cases the code and keyCode fields usually still identify the physical key.
Why does nothing appear when I press Fn, Print Screen or the Windows key?
Fn is handled inside the keyboard and never sent to the computer as a key. Print Screen on Windows and the Windows key are intercepted by the operating system before the browser sees them, as are most media and brightness keys. None of these mean the key is broken; they are simply not visible to a web page.
Can I use this to find the key code for a game or a script?
Yes. Press the key and use the code value for anything that works with physical keys, such as game binds, AutoHotkey or JavaScript event handlers, and the key value for anything that cares about the character typed. If a library or game still asks for a numeric keyCode, the number is shown next to the code.
More keyboard tests
Each test below checks one part of your keyboard in more detail.