Home
KeyCodeInspectorv2.0 Client-Side
Private

JavaScript Keyboard Event & KeyCode Inspector

Press any key on your keyboard to instantly see its event.key, event.code, which, keyCode, and active modifier flags in real-time.

13keyCode / which
Enter / Return
Click here or press any key on your keyboard

Carriage return / Submit line break key.

Mobile & Touchscreen Quick Simulation Keys:
Load Sample Key:
event.keyStandard
Enter
Generated character
event.codePhysical
Enter
Keyboard layout key
which / keyCodeLegacy
13
Deprecated numeric code
event.locationPosition
0 (Standard)
Standard / Left / Numpad

Modifier Flags & Keyboard State

Active toggles glow during keystroke
Shiftfalse
Ctrlfalse
Alt / Optfalse
Cmd / Winfalse
Repeatfalse
IME Compfalse
Caps Lockoff
Num Lockoff

Search & Keycode Lookup

Don't have a physical key? Enter a character, name, or numeric keycode (e.g. "Enter", "13", "Space", "KeyA")

KeyboardEvent Object Attributes
event.key"Enter"
event.code"Enter"
event.which13
event.keyCode13
event.charCode0
event.location0 (0 (Standard))
event.type"keydown"
event.repeatfalse
event.isComposingfalse
event.timeStamp1791741152257 (5:52:32 PM)

Modern Web Developer Guide: event.key vs event.code vs keyCode

For over two decades, web developers relied on event.keyCode and event.which to capture keyboard interactions. However, the W3C DOM Level 3 Events specification formally deprecated these properties due to inconsistent cross-browser values and lack of international keyboard layout adaptability.

event.key (Value-Oriented)

Represents the value of the key pressed, taking into account Shift modifiers, CapsLock, and international layouts. Pressing the 'A' key yields "a", but when holding Shift, it becomes "A". Ideal for form inputs, shortcuts, and text editor manipulation.

event.code (Position-Oriented)

Represents the physical key location on the keyboard, independent of the operating system's selected language or active layout. For example, the top-left letter key always emits "KeyQ" on a standard US QWERTY keyboard, but also on AZERTY keyboards where the engraved letter is 'A'. Essential for browser games (WASD navigation).

Deprecation Advisory: Avoid writing new code with e.keyCode === 13. Prefer modern standard syntax: e.key === 'Enter'. This avoids unexpected bugs on non-US keyboards and mobile browsers.