Skip to content

Keycode Info

Press any key to instantly see its key name, code, keyCode, and modifier state - useful for building and debugging keyboard shortcuts.

Category: web
Use Case: Building Keyboard Shortcut Handlers, Debugging Cross-Browser Key Differences, Identifying an Unusual Key's Code
Privacy: 100% browser-based

Press any key

Recommended Settings

Pro Tips

  • 'code' identifies the physical key position and never changes with keyboard layout, while 'key' reflects the actual character produced, which does change with layout
  • 'keyCode' and 'which' are legacy, deprecated properties still widely supported for backward compatibility, but 'code' and 'key' are the modern standard
  • The location value distinguishes duplicate keys, like Left Shift vs Right Shift, or a numpad key vs its main-keyboard equivalent
  • Modifier keys (Ctrl, Shift, Alt, Meta) are detected even when held alongside another key, useful for testing multi-key shortcuts

Most Popular

Most developers use this to look up the exact 'code' value needed to detect a specific physical key in a keyboard shortcut handler

When to Use This Tool

Building Keyboard Shortcut Handlers

Find the exact key code needed to detect a specific keyboard shortcut in your code.

Debugging Cross-Browser Key Differences

Check how a browser reports a key's event properties to diagnose inconsistent shortcut behavior.

Identifying an Unusual Key's Code

Discover the code for a media key, function key, or other less common key.

Teaching Keyboard Event Handling

Demonstrate the difference between key, code, and legacy keyCode properties.

How It Works

1

Listen for keydown events on the page while it has focus

2

Read the key, code, keyCode, which, location, and modifier properties from each event

3

Display the most recently pressed key's full event details

100% Private

Files never leave your device. All processing happens locally in your browser.

Lightning Fast

Powered by Client-side KeyboardEvent API for optimal performance on modern browsers.

Open Source

Built with verified, open-source libraries. Fully transparent.

Frequently Asked Questions

Why are keyCode and which marked deprecated?

Both properties are officially deprecated in the web standards in favor of 'key' and 'code', though browsers still support them for compatibility with older code.

What's the difference between 'key' and 'code'?

'code' represents the physical key position and stays constant regardless of keyboard layout, while 'key' represents the actual character or action produced, which can vary by layout, language, and Shift state.

Why doesn't my browser's shortcut (like Ctrl+W) show up here?

Browsers intercept and reserve many shortcuts for their own use (closing tabs, opening dev tools, etc.) before a page's JavaScript ever sees the keydown event.

Is my keyboard input sent anywhere?

No. Key events are captured and displayed entirely within your browser and are never transmitted anywhere.