Fast, Private & Client-Side Developer Suite
100% Client-Side • Private
Developer Utilities

JavaScript Keycode Info

Inspect keyboard event.key, code, which, and keyCode values with live keypress listener.

Loading tool...

Related Tools

Continue with IPv4 CIDR Calculator, User Agent Parser Online, Chmod Calculator.

How to Use JavaScript Keycode Info

  1. Press any physical key on your keyboard.
  2. Inspect the large numeric keyCode and modern event.key/code properties.
  3. Check modifier key states (Ctrl, Shift, Alt, Meta).
  4. Copy the generated JavaScript keydown event listener code block.

Frequently Asked Questions

What is the difference between event.key and event.code?

event.key returns the value of the key pressed (taking Shift/Caps into account, like "A" or "a"), while event.code represents the physical key on the keyboard layout (like "KeyA").

Why is keyCode deprecated in modern JavaScript?

event.keyCode was inconsistent across different operating systems and non-QWERTY layouts. Modern web development standardizes on event.key and event.code.

Sources & References

Primary references: ECMAScript Language Specification.

Review policy: references and behavior notes are checked whenever the tool implementation changes.