Skip to main content
Toolbox
Developer

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.

Quick Answer & Summary

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.

Press any key on your keyboard
75
JavaScript Event KeyCode / Which
Key "k" (KeyK)
event.key
"k"
event.code
"KeyK"
event.which / keyCode
75
event.location
0 (Standard)
Active Modifier Flags
Control (Ctrl)
false
Shift
false
Alt / Option
false
Meta / ⌘ / ⊞
false
JS Event Handler Snippet
window.addEventListener("keydown", (e) => {
  if (e.code === "KeyK") {
    e.preventDefault();
    console.log("Pressed k");
  }
});
Common Keyboard Event Reference
Key Nameevent.keyevent.codeevent.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.

TB
Toolbox Editorial TeamVerified Authors

Systems & Security Engineers • Applied Cryptography & High-Performance Web Tools

Updated:
100% In-BrowserZero server storage
Standards AuditedRFC & ISO compliant
Peer ReviewedEditorial Policy
Documentation & Guide

How to Use JavaScript Keycode & Event Inspector

1

Press any key

Simply type any key combination or shortcut on your keyboard.

2

Inspect event properties

View the modern event.key and event.code values alongside legacy keyCodes and location indices.

3

Copy JavaScript snippet

Copy the pre-written JavaScript conditional code for handling this specific keypress in your web application.

Pro Tips
Modern web development recommends using event.code (physical key) or event.key (produced character) instead of deprecated numeric event.keyCode.

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: