Press any key
The viewer listens anywhere on this page, so you can start immediately with a physical keyboard.
Press any key to reveal its JavaScript KeyboardEvent values instantly, including event.key, event.code, keyCode, location and active modifiers.
Physical key position
The viewer is active across this page. Your keystrokes stay in this browser and are never saved.
| Key | Code | Key code | Location | Modifiers |
|---|---|---|---|---|
| Your recent key events will appear here. | ||||
Private by design: keyboard data is processed locally and never stored.
Test a single key, a shortcut or a keyboard layout in seconds. There is nothing to install and no form to submit.
The viewer listens anywhere on this page, so you can start immediately with a physical keyboard.
Compare the logical key, physical code, numeric legacy values, location and modifier state.
Select a value card to copy one property, or copy the complete event as formatted JSON.
The modern KeyboardEvent API separates what a key means from where it sits on a physical keyboard. That distinction matters for shortcuts, games, international layouts and accessible interactions.
| Property | What it tells you |
|---|---|
event.key | The character or action produced, such as a, A, Enter or ArrowLeft. It can change with Shift and keyboard layout. |
event.code | The physical key position, such as KeyA or Numpad1. It stays tied to the same key location across layouts. |
keyCode | A deprecated numeric value kept for testing and maintaining older websites. Prefer key and code in new code. |
location | Shows whether the key is standard, on the left or right side, or on the numeric keypad. |
event.key describes the character or action produced. event.code identifies the physical key position. A different keyboard layout can change key while code stays the same.
keyCode and which are legacy numeric properties. They are useful when debugging older code, but both are deprecated. New JavaScript should generally use event.key and event.code.
No. Key event details are processed only in your browser. The short history disappears when you clear it, leave the page or reload.
The viewer observes keyboard events without blocking normal browser behavior. Shortcuts such as refresh, find, close tab or open developer tools may still run.
This tool is designed for physical keyboards. On-screen mobile keyboards do not always emit the same browser events, so connect a hardware keyboard for reliable testing.
Test, format and debug faster with these free online utilities.