KeyCode & Event Inspector

Keyboard / Event

Press any key on your keyboard to instantly inspect JavaScript keyboard event properties: event.key, event.code, event.which, and modifier keys.

Private by architecture: All processing is 100% client-side memory. Your data never leaves this browser tab.
JavaScript KeyCode
-
Press any key to test
⌘ Meta / Win
Ctrl
Alt / Option
Shift
event.key
-
event.code
-
event.which / keyCode
-
event.location
-
Recent Key Events
Key Code KeyCode Modifiers
No key events captured yet. Press any key on your keyboard.
Common Navigation KeyCodes:
Enter: 13 Escape: 27 Space: 32 Tab: 9 Backspace: 8 ArrowUp: 38 ArrowDown: 40

About This Tool

Attaches a standard DOM keydown event listener to inspect every keyboard property reported by your browser: event.key, event.code, event.which, legacy keyCode, and event.location. Useful for debugging shortcut handlers, cross-browser key differences, and international layout inputs.

Features an interactive stream log comparing recent key events side by side. Keystrokes are ignored when typing inside standard form inputs so you can still navigate normally.

Key Features

  • Hero key display: Real-time key name and numeric legacy keyCode in large legible typography.
  • Four property inspection cards: Side-by-side readouts for event.key, event.code, event.which, and event.location.
  • Live modifier lights: Visual indicators for Meta, Ctrl, Alt, and Shift modifier key states.
  • 20-Row event stream: Chronological event table capturing keystrokes and modifier combinations.
  • Input-safe listener: Suspends key capture automatically when cursor is inside any text field.
  • 100% Client-side: All keyboard events are read locally with zero analytics logging of user input.

Frequently Asked Questions

What is the practical difference between event.key and event.code?
event.key represents the printable character or action produced taking into account keyboard layout and Shift states (e.g. "a" vs "A"). event.code represents the physical hardware key position on the keyboard (e.g. "KeyA"), regardless of language layout.
Are event.keyCode and event.which still relevant in modern development?
They are legacy numeric codes deprecated in the W3C UI Events specification, but still frequently encountered in legacy libraries. They are displayed here for backwards-compatibility reference.
What does event.location indicate?
event.location identifies whether a key originated from the standard keyboard area (0), left modifier (1), right modifier (2), or numeric keypad (3).
Why does typing inside an input field not update the inspector?
The keydown listener ignores events originating from form inputs and textareas so user interactions and clipboard paste shortcuts continue functioning without interference.
Are any keystrokes or passwords recorded or uploaded?
No. Keystrokes are processed strictly in browser volatile memory and cleared upon page refresh. Nothing is sent to a remote server.