JavaScript KeyCode Tool

Press any key to see its JavaScript key event properties

Press any key to see its information

Click anywhere on this page first if keys aren't registering

About Key Events

event.key

The value of the key pressed. For printable characters, this is the character itself. For special keys, it's a descriptive name.

event.code

Represents the physical key on the keyboard. This is useful when you want to handle keys by their physical position regardless of layout.

event.keyCode (deprecated)

A numeric code representing the key. While still supported, it's deprecated. Use event.key or event.code instead.

event.location

Indicates where the key is on the keyboard: Standard (0), Left (1), Right (2), or Numpad (3).