Too Much Tools logoToo Much Tools

Keycode Info

Press any key to see its JavaScript event.key, code, keyCode and modifiers, locally.

Local, Runs entirely in your browser, your data never leaves your device.
Loading tool…

Press a key, see exactly what JavaScript receives

This tool listens for a keydown event and shows you the resulting key, code, legacy keyCode, keyboard location (standard, left, right or numpad) and any modifier keys held down. It's meant for writing or debugging keyboard shortcuts, where the difference between event.key ('a') and event.code ('KeyA'), or which numpad key fired, actually matters. The event is captured and read directly in your browser; no keystroke data leaves the page.

How to use the Keycode Info

  1. Click into the key-capture area so it has focus.
  2. Press any key, key combination, or modifier on your keyboard.
  3. Read the resulting key, code, keyCode and location fields.
  4. Check the modifiers list to confirm which of Ctrl, Alt, Shift or Meta were held.
  5. Press another key to replace the result and compare.

event.key reflects the character or named key produced (accounting for Shift and layout), while event.code identifies the physical key position regardless of layout, so they can differ meaningfully for shortcut handling logic.

keyCode is a legacy, deprecated numeric field kept here for reference since some older code still checks it; new code should prefer event.key or event.code, both of which are shown alongside it.

Frequently asked questions

What's the difference between event.key and event.code?
event.key is the character or logical name the key produces, affected by Shift and keyboard layout, while event.code identifies the physical key position and stays the same regardless of layout or modifiers.
Is my keystroke data sent anywhere when I press a key?
No, the keydown event is captured and read by JavaScript running in your own browser tab; nothing about which keys you press is transmitted or stored.
Why is keyCode shown if it's deprecated?
Some existing code and libraries still branch on the numeric keyCode value, so it's included for reference alongside the modern event.key and event.code fields that should be used in new code.
What does the location field tell me?
It reports whether the key came from the standard keyboard area, the left or right side (for keys like Shift or Ctrl that exist twice), or the numeric keypad, matching the DOM KeyboardEvent.location values.