Keycode Info
Press any key to inspect its KeyboardEvent properties instantly.
Reviewed by Aygul Dovletova · Last reviewed
How to Use Keycode Info
- Click the capture field to focus it.
- Press any key on your keyboard. The table below updates instantly with that key's KeyboardEvent properties.
- Read the properties including key, code, keyCode, location, and any active modifier keys (Ctrl, Alt, Shift, Meta).
What This Tool Does
Keycode Info attaches a keydown listener to a focused input and captures the full KeyboardEvent data when you press a key. It displays key (the logical value), code (the physical key position), the deprecated keyCode and which values, location (distinguishing standard, left, right, and numpad keys), and all four modifier flags. No data is sent to any server - everything runs in your browser.
Frequently Asked Questions
What is the difference between event.key and event.code?
event.key returns the value of the key (e.g. "a", "Enter", "ArrowUp") and is layout-dependent - it changes based on the OS keyboard layout. event.code returns the physical key position (e.g. "KeyA", "Enter", "ArrowUp") and is layout-independent. Use event.code when you want to respond to a physical key regardless of what character it produces.
Why is keyCode deprecated?
keyCode is a legacy property from before the KeyboardEvent spec was standardized. It returns inconsistent numeric values across browsers for non-printable keys. The modern replacement is event.key (for the value) and event.code (for the physical key). keyCode is still displayed here because it is widely used in existing codebases.
What does location mean?
location identifies where on the keyboard the key is physically located: 0 = Standard (most keys), 1 = Left modifier, 2 = Right modifier, 3 = Numpad. Useful for distinguishing left Shift from right Shift.
More Developer Tools
AI Token Counter
Count tokens for GPT-4o, Claude, and Gemini models instantly.
Open toolBase64 Encoder & Decoder
Encode UTF-8 text to Base64 online or decode Base64 back to UTF-8 and plain text. Runs in your browser with no upload.
Open toolBulk URL Encode / Decode
Encode or decode many URLs at once. Paste a newline-separated list and the tool processes each line in parallel, preserving order and blank lines.
Open toolchmod Calculator
Calculate and convert Unix file permission modes between octal and symbolic.
Open toolCode Screenshot
Create beautiful code snippet images with customizable themes.
Open toolColor Converter
Convert colors between HEX, RGB, HSL and CMYK formats.
Open tool