Online keyboard input test

Keypress Tester

Press any key to verify keyboard input and inspect the JavaScript KeyboardEvent values your browser sends.

Quick Answer

A keypress tester shows which key was pressed and exposes the browser event data behind it, including event.key, event.code, event.keyCode, modifier keys, and repeat status.

Live Keypress Tester

Press a key now. The tester updates with the current KeyboardEvent values so you can confirm the input your app would receive.

Current key press

Waiting...

Press any key to start

event.key

-

Value produced by the key

event.code

-

Physical keyboard position

event.keyCode

-

Legacy numeric value

event.which

-

Legacy alias

event.location

-

Left, right, or numpad hint

event.repeat

-

True when held down

Modifier Keys

Waiting

Shift, Ctrl, Alt, Meta

Common Uses

  • Confirm a keyboard key is physically working.
  • Debug keyboard shortcuts before wiring them into an app.
  • Compare event.key, event.code, and legacy keyCode values.
  • Check Shift, Control, Alt, and Meta modifier states.

Event Values to Watch

event.key

The character or named key value, such as a, Enter, Escape, or Shift.

event.code

The physical keyboard position, such as KeyA or ArrowUp, independent of layout.

event.keyCode

A legacy numeric key value that older code may still need to compare.

Frequently Asked Questions

What does a keypress tester show?

It shows the live KeyboardEvent details for the key you press, including the key value, physical code, legacy keyCode, modifier keys, and repeat state.

Can I test special keys like Escape, Tab, and Shift?

Yes. The tester listens for standard keyboard events, so it can show values for letter keys, number keys, function keys, modifiers, arrows, Tab, Escape, Enter, and more.

Why do event.key and event.code differ?

event.key represents the value produced by the key, while event.code represents the physical key location. That difference matters for keyboard layouts, shortcuts, and games.

Related Keyboard Event Guides