Keycode Info

Display keyboard keycodes and event information for key press debugging and development

Press any key on your keyboard to get its JavaScript event codes

Simply press any key (Space, Enter, letters, numbers, arrows, function keys) and see its properties instantly

About Keycode Info Tool

Test keyboard events and display detailed keycode information for web development and debugging. Our tool captures key press events and shows keyCode, charCode, key values, and event properties - essential for building keyboard-driven applications and debugging input handling.

  • Real-time keycode detection
  • Event property display
  • Cross-browser compatibility
  • Special key recognition
  • Modifier key detection
  • Character code mapping

Frequently Asked Questions

How to find the keycode of any key?

To find the keycode of any key, open the utilAZ keycode info tool and press the key you want to identify. The tool instantly displays the numeric keyCode value, the event.key string, and the event.code physical key identifier. This works for all keys including letters, numbers, function keys, arrows, and special characters.

What is the keycode info tool used for?

The keycode info tool is used by web developers and game developers to identify keyboard event properties in real time. It helps when building keyboard shortcuts, handling user input in forms, creating game controls, debugging event listeners, and ensuring cross-browser compatibility of keyboard interactions.

How to detect a spacebar in javascript?

To detect a spacebar press in JavaScript, listen for the keydown or keyup event and check if event.code equals 'Space' or event.key equals ' ' (a single space character). The legacy event.keyCode for spacebar is 32. Using event.code is recommended because it identifies the physical key regardless of keyboard layout.

Difference between event key and event code?

event.key returns the character value produced by the key press (like 'a', 'A', or 'Enter'), which changes based on modifier keys and keyboard layout. event.code returns the physical key position on the keyboard (like 'KeyA' or 'Space'), which stays the same regardless of layout or language. Use event.key for text input and event.code for game controls or shortcuts.

How to test keyboard events online?

You can test keyboard events online using the utilAZ keycode info tool. Simply open the page, click in the testing area, and press any key. The tool displays all event properties including keyCode, key, code, which, charCode, and modifier states (Ctrl, Alt, Shift, Meta) in real time without any installation required.

Common Key Categories

Letters & Numbers:

  • A-Z: 65-90
  • 0-9: 48-57
  • a-z: 97-122 (lowercase)
  • Space: 32

Special Keys:

  • Enter: 13
  • Tab: 9
  • Escape: 27
  • Backspace: 8
  • Delete: 46

Function Keys:

  • F1-F12: 112-123
  • Arrow Up: 38
  • Arrow Down: 40
  • Arrow Left: 37
  • Arrow Right: 39