Keycode Event Inspector

Press any key to inspect its event data — key, code, and numeric keycode — live in the browser.

Keycode Event Inspector Runs locally · No sign-up
Press any key
Click here, then press any key on your keyboard.
Key details
Press a key to see its code.

About Keycode Event Inspector

Handling keyboard input in JavaScript means working with event properties like key, code, and the legacy keyCode, and the differences between them confuse nearly everyone at some point. This inspector shows exactly what your browser reports when you press a key, turning guesswork into observed facts.

Click to focus the inspector, press any key, and the tool displays the key value, the physical code (like Space or KeyA), and the legacy numeric keyCode, plus which modifiers are held. Because it reads the real KeyboardEvent produced by your browser, what you see is precisely what your handlers will receive.

Front-end developers use it when building keyboard shortcuts, custom inputs, and games, checking how different keys and layouts report. It's also a teaching tool — seeing key versus code side by side makes the distinction click instantly. QA testers use it to verify that keyboard interactions trigger the right events across browsers.

How to Use

  1. Click the inspector area to focus it.
  2. Press any key on your keyboard.
  3. Read the key, code, and keyCode values displayed.

Example

Press the spacebar key: " " · code: "Space" · keyCode: 32

The inspector shows both the friendly code name (Space) and the legacy numeric keycode (32), plus modifiers held.

FAQ

What's the difference between key and code?

key is the character produced (like 'a'), while code is the physical key position (like 'KeyA'), which stays the same across layouts.

Why is keyCode deprecated?

It's ambiguous across layouts and shifted characters. Modern code should prefer key and code instead.

Can I test modifier combinations?

Yes, the inspector reports whether Shift, Ctrl, Alt, and Meta are held during the keypress.

Why do some keys show empty values in the inspector?

Some physical keys, especially modifier keys or certain dead keys, report an empty key string while still having a valid code. That's normal browser behavior — the code value remains the reliable way to identify the physical key.

Is the numeric keyCode still reliable for game input?

KeyCode is deprecated and unreliable across layouts and shifted characters, so modern game development prefers code, which reflects the physical key position regardless of what character it produces.