Keyboard key codes

Every key press gives a browser three different values. They mean different things, and only one of them is about the physical key.

Esc
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
` ~
1 !
2 @
3 #
4 $
5 %
6 ^
7 &
8 *
9 (
0 )
- _
= +
Backspace
Tab
Q
W
E
R
T
Y
U
I
O
P
[ {
] }
\ |
Caps
A
S
D
F
G
H
J
K
L
; :
' "
Enter
Shift
Z
X
C
V
B
N
M
, <
. >
/ ?
Shift
Ctrl
Win
Alt
Alt
Win
Menu
Ctrl
PrtSc
Scroll
Pause
Ins
Home
PgUp
Del
End
PgDn
↑
←
↓
→
Num
/
*
-
7
8
9
+
4
5
6
1
2
3
↵
0
.

Press any key on your keyboard. Every key you press stays marked, so you can work across the board and see what is left.

– untested

0 working

0 keys at once

Last key
press a key
Character
–
Key code
–
Held
–

The three values

The tester above shows all three for the last key you pressed, which makes the difference obvious. Press a letter, switch your operating system keyboard layout, and press the same key again: the code stays put and the character changes.

ValueWhat it describesExample pressing the same key
codeThe physical key position. Does not change with your language settings.KeyA
keyThe character produced, after the operating system layout is applied.a, or q on a French layout
keyCodeA legacy number kept for compatibility. Deprecated, but still widely used.65

Why code is the one you usually want

If you are checking hardware, the code is the honest value. It says which physical switch closed, regardless of what language the computer thinks it is in. A key that produces the wrong character but the right code is not broken.

If you are writing software, the same logic applies to anything positional. Game movement bound to the position of W, A, S and D should use the code, so the binding lands in the same physical place on a French AZERTY keyboard. Anything about the character the user meant to type should use the key value instead.

Common codes worth recognising

Left and right modifiers report separately, which is useful when testing: a keyboard where the left Shift works and the right does not will show that clearly.

KeysCodes
LettersKeyA to KeyZ
Digits along the topDigit0 to Digit9
Number pad digitsNumpad0 to Numpad9
Function rowF1 to F12
ModifiersShiftLeft, ShiftRight, ControlLeft, AltLeft, MetaLeft
ArrowsArrowUp, ArrowDown, ArrowLeft, ArrowRight
The ISO key beside left ShiftIntlBackslash

Keys a browser cannot see

The Fn key on a laptop is handled inside the keyboard controller and almost never reaches the operating system, so no web page can test it. Media keys, brightness keys and similar controls are often handled the same way.

Print Screen is usually captured by the operating system or a screenshot tool first. The Windows and Command keys frequently open a system menu instead of reaching the page. None of these silences mean a fault.

Why keyCode is deprecated but still everywhere

The numeric code predates both of the other values and was never well specified across browsers, which is exactly why it was replaced. It survives because an enormous amount of existing code reads it, and removing it would break those pages.

It is shown here because it is still the value many older tools and forum answers refer to, so having it on screen saves a lookup. For anything new, the physical position and the character are the two values worth using.

Repeat events

Holding a key down produces one initial event and then a stream of repeats generated by the operating system, not by the keyboard. Those repeats are marked as such, which is why the keys-at-once counter in the tester does not climb while you lean on a key.

The distinction matters when reading a chatter result. A repeat is the system doing its job at the interval your system settings specify. Chatter is a second genuine press arriving faster than a human could produce one, and the two are counted differently here for that reason.

Recommended Keyboard Tools & Hardware

Fix stuck switches, clean key chatter, and upgrade your mechanical keyboard typing experience.

KEYBOARD GEAR
Custom Keyboard Pro Keyboard

Keychron Hot-Swappable Custom Mechanical Keyboard (QMK/VIA)

Acoustic-dampened gasket-mounted mechanical keyboard with pre-lubed mechanical switches, South-facing RGB, and full QMK/VIA key remapping. Hot-swappable PCB allows switch replacement in seconds without soldering.

Replaces broken membrane boards with true N-Key Rollover and zero latency ghosting
Switch Modding Modder Essential

Krytox 205g0 Switch Lubricant & Complete Keyboard Modding Kit

Authentic high-viscosity PFPE grease paired with GPL 105 spring oil, 4-prong precision stem picker, switch opener tool, and fine nylon brushes for tuning mechanical switches and stabilizers.

Eliminates scratchy friction and spacebar rattle for ultra-smooth keystrokes
Maintenance & Repair Stuck Key Fix

Multi-Function High-Density Keyboard & Keycap Cleaning Kit

Precision electronics cleaning kit featuring high-density nylon brush, silicone crevice pick, flocking sponge, keycap remover, and residue-free cleaning solution.

Resolves 90% of stuck keys, key chatter, and unresponsive switches caused by dust
Switch Testing Switch Tester

Mechanical Switch Tester & Sampler Unit (Multi-Brand Switches)

Clear acrylic desk switch testing base mounted with genuine linear, tactile, and clicky switches (including Red, Brown, Blue, and Black variants) with clear keycaps.

Lets you feel exact actuation force and sound profiles before ordering full switch packs
Ergonomics Comfort Must

Ergonomic Memory Foam Wrist Rest with Cooling Lycra Fabric

High-density slow-rebound memory foam wrist support cushion with breathable moisture-wicking fabric and textured non-skid rubber base for full-size, TKL, and compact keyboards.

Relieves repetitive strain and keeps wrists in an aligned neutral typing plane
Modding Tool Essential Tool

2-in-1 Stainless Steel Wire Keycap Puller & Switch Remover

Durable dual-purpose modding tool with bend-resistant stainless steel wire loops for pulling keycaps and hardened alloy tongs for pulling hot-swap switches safely from PCB sockets.

Extracts keycaps without scratching plastic walls or bending hot-swap copper pins

Mechanical Keyboard Troubleshooting & Diagnostic Matrix

Common mechanical switch failures, root hardware causes, and verified fixes for chatter and stuck keys.

Observed Fault Root Cause Diagnostic Test Corrective Hardware Action
Key Chatter / Double Letters Dust, crumb buildup, or copper leaf contact oxidation Rapid single-key strike test in tester tool Blow compressed air or flush switch with quick-dry contact cleaner.
Dead / Completely Unresponsive Key Bent hot-swap pin or broken PCB solder trace Check neighboring matrix keys for common trace failure Pull switch with switch puller, straighten pin, or reflow solder joint.
Sticky / Sluggish Key Return Spilled beverage syrup or dried sugar residue on sliders Slow deliberate press to feel scratchy friction resistance Remove keycap, clean stem with 99% isopropyl alcohol, and relube.
Ghosting / Missing Simultaneous Keys 2-Key Rollover (2KRO) membrane matrix blocking Press Shift + W + D + Space simultaneously Upgrade to true N-Key Rollover (NKRO) mechanical keyboard.
Rattly / Hollow Spacebar Sound Loose tolerance between stabilizer wire and nylon stem housing Lightly tap left and right edges of spacebar listening for ticking Apply Krytox 205g0 or dielectric grease to wire bends.
Wrist Fatigue & Palm Aches Excessive upward wrist extension angle while typing Observe wrist angle relative to desk tabletop Add an ergonomic memory foam wrist rest to achieve neutral forearm posture.
TECH TIP
Switch Chatter and Contact Leaf Oxidation: Mechanical switches register keystrokes when the slider presses two flexible copper alloy leaves together. Over months of use, airborne dust, skin oils, or humidity create microscopic resistive films on the contact surfaces. When the contact makes connection, the electrical voltage bounces rapidly instead of transitioning cleanly, causing the keyboard controller firmware to register double or triple characters per press. Before desoldering a switch, try depressing the stem fully and dispensing one quick burst of quick-drying zero-residue electronic contact cleaner directly into the housing. In 90% of cases, this dissolves the oxidation and cures key chatter immediately.

As an Amazon Associate we earn from qualifying purchases. Affiliate Disclosure