🔒 Runs in your browser — nothing is uploaded✓ Free, no signup

JavaScript Keycode Finder

Press any key to see its event.key, event.code and keyCode values, with modifiers and a ready-to-paste keydown handler.

Press any key

Its key, code and keyCode will appear here.

Common key codes

event.codeevent.keykeyCode
Enter"Enter"13
Escape"Escape"27
Space" "32
Tab"Tab"9
Backspace"Backspace"8
Delete"Delete"46
ArrowLeft"ArrowLeft"37
ArrowUp"ArrowUp"38
ArrowRight"ArrowRight"39
ArrowDown"ArrowDown"40
ShiftLeft"Shift"16
ControlLeft"Control"17
AltLeft"Alt"18
MetaLeft"Meta"91
KeyA"a"65
Digit0"0"48
F1"F1"112
Home"Home"36
End"End"35
PageUp"PageUp"33
PageDown"PageDown"34

When should you use the Keycode Info?

  • Writing keyboard shortcuts for a web app
  • Checking what a key reports on a different keyboard layout
  • Debugging keyboard handling in games and editors

How to use the Keycode Info

  1. 1

    Press a key

    Click on the page if needed, then press any key. On a phone, tap the text box first.

  2. 2

    Read the values

    See event.key, event.code, keyCode, which, location and modifier keys.

  3. 3

    Copy what you need

    Copy a single value or the JavaScript snippet.

  4. 4

    Check the reference

    The table lists common keys like Enter (13) and Escape (27).

Examples

Pressing Enter

Key

Enter

Event

event.key      "Enter"
event.code     "Enter"
event.keyCode  13

Common errors and how to fix them

keyCode is 229
The keyboard is composing text (common on Android and with IME input). Use the input event instead of keydown there.
A browser shortcut ran instead
Some keys, like Ctrl+W, are reserved by the browser and never reach the page.
Related tools: Regex Tester · Screen Resolution Checker · User Agent Parser

More from Web & Network

Free tools that run in your browser — no signup, nothing uploaded.

Keycode Info FAQ

Use event.key for the character typed (it follows the keyboard layout) and event.code for the physical key position (good for games). keyCode is deprecated but still shown for older code.

On a French AZERTY keyboard, the key left of Z gives event.key "a" but event.code "KeyQ" — code is the position on a US layout, key is the actual character.

Which copy of a key was pressed: 0 standard, 1 left (left Shift), 2 right, 3 numpad.

Its values were never standardised across browsers and layouts. event.key and event.code replace it, but keyCode still works for compatibility.

Enter is 13, Escape is 27 and Space is 32. The arrow keys are 37–40.

No. Everything runs in your browser, so your key presses never leaves your device.