UtilToolkits
Request a Tool
Home
AI Tools
Text Tools
Image Tools
CSS Tools
Coding Tools
Color Tools
Calculator Tools
Productivity Tools
Fun Tools
Video Tools
Other Tools
BlogAI Content Detector
CodeCast
Play CodeType CodeCode to Image

Your Favorites

Sign in to view your favorites

Tool Categories

Browse by category
AI (10)Text (14)Image (14)CSS (9)Coding (23)Color (4)Calculator (9)Productivity (8)Fun (4)Video (7)Other (2)All tools →Blog →
UtilToolkits
© 2026 UtilToolkits. All Rights Reserved.
AboutContactPrivacyTerms

More Coding tools

See all Coding tools →
  • JSON to TypeScript

    Instantly generate TypeScript interfaces from JSON objects.

  • Code to Image

    Create beautiful images of your code snippets for sharing.

  • SQL Formatter

    Format and beautify your SQL queries.

  • Cron Expression Generator

    Visually build and explain cron job schedules.

  • Meta Tag Generator

    Generate SEO meta tags for your website.

  • Chmod Calculator

    Visual calculator for Unix file permissions.

Quick Tip: Miscellaneous

Don't eyeball it, convert it! A Unit Converter is perfect for recipes, travel, or any time you need to switch between metric and imperial.

  1. Home
  2. Tools
  3. Keycode Event Info

About this Tool

Debug your keyboard. Press any key to see its JavaScript event codes (`key`, `code`, `which`). Essential for developers building games, accessibility features, or custom shortcuts.

JavaScript handles keyboard input through events. Knowing the exact `code` (physical key) vs `key` (character value) is crucial. For example, 'Z' on a US keyboard is different from 'Z' on a German keyboard—this tool shows you exactly what the browser sees.

  1. Press any key on your keyboard.
  2. Instantly see the event data.
  3. Copy the code you need.
  • Mapping game controls.
  • Creating custom shortcuts (Ctrl+S).
  • Debugging keyboard event listeners.
  • Instant Feedback: No delay.
  • Comprehensive Data: Shows Key, Code, Which, and Location.
  • Modifier Support: Detects Shift, Ctrl, Alt.

It adds a global `keydown` event listener to the window and simply prints out the event object's properties: `e.key`, `e.code`, `e.which`, etc.

What is the difference between key and code?

`key` is the character generated (e.g., 'a' or 'A'). `code` is the physical button pressed (e.g., 'KeyA'). `code` doesn't change with keyboard layout.

Why is 'which' deprecated?

It was inconsistent across browsers. `key` and `code` are the modern standards.

Does it detect held keys?

Yes, it will show the 'repeat' property as true if you hold a key down.

All calculations and data processing for this tool are performed locally in your browser. UtilToolkits does not send any of your data to an external server, ensuring your information remains private and secure.

Credits:Next.js•React•Tailwind CSS•Lucide Icons

Keycode Info

⌨️

Click here, then press any key

Browser shortcuts (Ctrl-T, F5, ⌘-W, …) keep working