Keycode info

Find the javascript keycode, code, location and modifiers of any pressed key.

Enable JavaScript to use the interactive tool. The guide below explains how it works.

Keycode Info: Master Keyboard Events and Shortcuts

Developing interactive web applications often requires handling keyboard events—whether for custom shortcuts, accessibility features, or game controls. However, different browsers and operating systems can sometimes report keyboard data inconsistently, making it a challenge for developers to know exactly which key codes to use in their code.

The Keycode Info tool provides an instant, real-time breakdown of every keyboard interaction. By simply pressing a key, you get all the technical metadata needed to implement robust keyboard logic in your JavaScript applications.

1. What the Tool Does

This tool captures keyboard events and displays detailed information about the pressed key. It provides the Key name, the legacy Keycode, the physical Code, the Location (e.g., standard vs. numpad), and any active Modifiers (Shift, Ctrl, Alt, Meta). Each value is presented in a copyable format for quick integration into your development workflow.

2. Why Professionals Use It

3. Step-by-Step Instructions

  1. Open the tool page.
  2. Click anywhere on the page to ensure it has focus.
  3. Press any key on your keyboard.
  4. The tool will instantly display the technical details for that specific key.
  5. Click the "Copy" icon next to any field (like "Keycode" or "Code") to copy that specific value.

4. Examples

5. FAQs

Q: What is the difference between "Key" and "Code"? A: event.key represents the character produced (e.g., "a" or "A"), while event.code represents the physical key on the keyboard (e.g., "KeyA"), regardless of modifiers or layout.

Q: Are "Keycodes" still recommended? A: event.keyCode is technically deprecated in modern web standards, but it is still widely used for legacy support. Most modern applications should prefer event.key or event.code.

6. Common Mistakes

7. Real-World Use Cases

8. Related Tools


Get the technical "fingerprint" of any keypress in an instant.

All tools

Guides and articles