Keyboard Key Code Viewer

Press any key…
Ctrl Alt Shift Meta ⌘
event.key event.code keyCode which

About this tool

Press any key while this page is focused and it shows the four identifiers a JavaScript keydown event carries: event.key (the character or named key, like "a" or "Enter"), event.code (the physical key, like "KeyA" or "ArrowLeft"), and the legacy numeric keyCode and which. The most recent key is shown large, and the ctrl / alt / shift / meta modifier pills light up while those keys are held.

event.code is the property to use for layout-independent shortcuts and games, while event.key reflects the actual character after modifiers and keyboard layout. keyCode and which are deprecated but still appear in older code. Nothing is sent anywhere — the page only listens for key events locally in your browser.

Related tools

HTML EscapeRegex TesterJSON Formatter