Keyboard Key Codes

Key names with the legacy keyCode plus the modern key and code values, including modifiers, navigation and function keys.

Search keyboard key codes

Showing 0 keys
Last key pressed: -
The keyCode property is deprecated but still widely used. Prefer the key and code properties in new code.

How to use the Keyboard Key Codes

  1. Search for a key by name, number or category.
  2. Compare the legacy keyCode with the modern key and code values.
  3. Click the test box and press a key to see the live values.

Features

Advertisement

Frequently Asked Questions

Common questions about the free online keyboard key codes.

keyCode is a legacy numeric property from old keyboard events, and it is deprecated but still supported by browsers.
Use the key property for the produced character and the code property for the physical key position.
The key value reflects the character produced, while code names the physical key regardless of layout.
Enter reports keyCode 13, its key value is Enter and its code value is also Enter.
The legacy keyCode cannot tell the two apart, but the code values ShiftLeft and ShiftRight can.
Code 27 is the Escape key, which still closes dialogs and cancels edits in most browsers.
Listen for keydown and compare event.key with ArrowUp, ArrowDown, ArrowLeft or ArrowRight.
The modern key and code values are standardised, while some legacy keyCode values can vary on older browsers.
Yes. It is completely free, needs no account and the live tester works entirely inside your browser.

Last updated: October 10, 2026