JavaScript Keycode & Event Inspector
Press any key on your physical or virtual keyboard to inspect keyCodes, event.key, event.code, modifier flags, and generate ready-to-use JavaScript event listener snippets.
The JavaScript Keycode & Event Inspector is a fast, accurate Developer utility designed to press any key on your physical or virtual keyboard to inspect keycodes, event.key, event.code, modifier flags, and generate ready-to-use javascript event listener snippets. entirely in your browser with zero server data storage.
window.addEventListener("keydown", (e) => {
if (e.code === "KeyK") {
e.preventDefault();
console.log("Pressed k");
}
});| Key Name | event.key | event.code | event.keyCode |
|---|---|---|---|
| Enter | "Enter" | "Enter" | 13 |
| Escape | "Escape" | "Escape" | 27 |
| Space | "Space" | "Space" | 32 |
| Tab | "Tab" | "Tab" | 9 |
| Backspace | "Backspace" | "Backspace" | 8 |
| Shift | "Shift" | "ShiftLeft" | 16 |
| Control | "Control" | "ControlLeft" | 17 |
| Alt | "Alt" | "AltLeft" | 18 |
| Meta | "Meta" | "MetaLeft" | 91 |
| ArrowUp | "ArrowUp" | "ArrowUp" | 38 |
| ArrowDown | "ArrowDown" | "ArrowDown" | 40 |
| ArrowLeft | "ArrowLeft" | "ArrowLeft" | 37 |
| ArrowRight | "ArrowRight" | "ArrowRight" | 39 |
Share This Tool
Help your team and fellow developers save time with free, private client-side utilities.
Systems & Security Engineers • Applied Cryptography & High-Performance Web Tools
How to Use JavaScript Keycode & Event Inspector
Press any key
Simply type any key combination or shortcut on your keyboard.
Inspect event properties
View the modern event.key and event.code values alongside legacy keyCodes and location indices.
Copy JavaScript snippet
Copy the pre-written JavaScript conditional code for handling this specific keypress in your web application.
Frequently Asked Questions (PAA)
Related Tools & Converters
Authoritative Standards & Citations
Calculations and algorithms on this page are implemented and verified in strict accordance with the following official technical specifications:
RFC 7519: JSON Web Token (JWT)
Standardized compact, URL-safe means of representing claims to be transferred between two parties.
Web Cryptography API Specification
Standard JavaScript API for performing basic cryptographic operations in web applications.
RFC 4122: A Universally Unique IDentifier (UUID) URN Namespace
Definition of uniform format and generation algorithms for UUIDs.