About JavaScript Keycode & event.key Inspector – Online
When you wire up a keyboard handler, the first question is always the same: what's the `event.key` for this key — and how does it differ from `event.code` or the old `keyCode`? This JavaScript keycode inspector answers it instantly. Press any key and it shows the modern `event.key` and `event.code` values, the deprecated numeric `keyCode`, the physical key location, and which modifiers (Ctrl, Alt, Shift, Meta) were held.
It's the fastest keycode finder for building shortcuts, games, and accessibility handlers: no docs to dig through, no console.log to add. Every value is individually copyable so you can paste it straight into a comparison or a switch statement.
Everything runs entirely in your browser. No keystroke is logged, stored, or sent anywhere — the page works offline and your input never leaves your device.
Features
- Live capture — press a key, see its values immediately
- event.key, event.code, and deprecated keyCode side by side
- Physical key location (Standard / Left / Right / Numpad)
- Active-modifier badges for Ctrl, Alt, Shift, and Meta
- Each value individually copyable; fully offline and private
How to use
- Click the "Press any key" capture box to focus it.
- Press any key (hold Ctrl/Alt/Shift/Meta to see modifiers).
- Read the event.key, event.code, keyCode, and location values.
- Copy any value with its copy button to use in your code.
Frequently asked questions
What's the difference between event.key and event.code?
event.key is the character or named value the key produces (e.g. "a", "A", "Enter"), affected by modifiers and keyboard layout. event.code is the physical key position (e.g. "KeyA", "Enter"), which stays the same regardless of layout. Use key for "what was typed" and code for "which physical key".
Should I still use keyCode?
No — keyCode (and which) are deprecated and inconsistent across browsers and layouts. Prefer event.key or event.code in new code. This tool still shows keyCode so you can migrate or debug legacy handlers.
What does the location value mean?
Some keys exist in more than one place — left vs. right Shift/Ctrl/Alt, or the numpad. location distinguishes them: Standard, Left, Right, or Numpad. For example, the numpad Enter reports code "NumpadEnter" with location Numpad.
Are my keystrokes recorded or sent anywhere?
No. The inspector reads each KeyboardEvent locally in your browser and displays it. Nothing is logged, stored, or transmitted, and the page works fully offline.
Related tools
Everything runs locally in your browser — your input is never uploaded.