Skip to main content
1

Keycode Info

Press any key to see all its JavaScript keyboard event properties: key, code, keyCode, which, charCode, and more.

Click here and press any key…
Send output to:
Advertisement

How to use Keycode Info

  1. Click the input area (or just start pressing keys).
  2. Press any key to see its event properties.
  3. Use the displayed values in your JavaScript code.

What is Keycode Info?

JavaScript keyboard events carry multiple properties (key, code, keyCode, which, charCode, location) that can be confusing. This tool shows all properties for any key you press, making it easy to find the right value for your event handlers.

Press any key — including modifier keys, function keys, and special characters — to see a complete breakdown of the event properties. Useful for building keyboard shortcuts, game controls, and accessibility features.

Advertisement

FAQ

What is the difference between key and code?
event.key is the character produced (e.g., 'a' or 'A'), while event.code is the physical key pressed (e.g., 'KeyA'). Use key for character input, code for physical layout-independent shortcuts.
Is keyCode deprecated?
Yes. keyCode is deprecated in the spec but still widely supported. Use key or code for new code.
Does this work with modifier keys?
Yes. Shift, Ctrl, Alt, Meta, CapsLock, and all other keys are supported. The tool also shows modifier state.

Related tools

Advertisement