Keycode Tester

Press any key to see its KeyboardEvent key, code, and keyCode values. Fast, free, and fully client-side.

Press any key

Waiting for input…

How the Keycode Tester Works

Listens for keydown events on the page and displays each key value as event.key, event.code, and the deprecated event.keyCode number. While the tool is open it prevents the default action for every key, and keys the operating system handles first never reach the page. Runs in your browser and nothing is uploaded.

Usage Example

Confirms that the numpad Enter key reports a different code from the main Enter key before mapping keys for a game.

Frequently Asked Questions

What is the difference between key and code?

key reports the character or action the layout produces, such as a capital A when Shift is held. code reports the physical key position, such as KeyA, which stays the same across keyboard layouts.

Why is keyCode marked as deprecated?

keyCode is a numeric value kept for older scripts, and the tool labels it as deprecated. Use key or code in new code.

Why does a key I press not appear?

The page prevents the default action for every key while it is open, and keys the operating system or browser handles before the page never reach it. Try the same key in another window to confirm.

Browse more

See all developer reference guides and interactive utilities.