Key Code & Event Tester

Press any key to see its JavaScript event code info.

Press any key on your keyboard

What are JavaScript Key Codes?

When you press a key in a web browser, a KeyboardEvent is fired. This event contains several properties describing which key was pressed.

  • event.key: The printed representation of the key (e.g., "a", "Enter").
  • event.code: The physical key on the keyboard (e.g., "KeyA", "Enter"). This ignores layout (QWERTY vs AZERTY).
  • event.which / event.keyCode: The deprecated numeric code (e.g., 65 for "a", 13 for "Enter"). Still widely used in legacy code.