⚡
usefultools.dev
KEY

Keycode Info

NEW

Press any key to see its event.key, event.code, keyCode, location and modifiers, with copy-ready JavaScript snippets and a history of your last 10 keys.

Runs 100% in your browser — your input is never uploaded or stored on our servers.

Click here, then press any keyKeyboard users: Tab to this box.

Keys are captured only while this box is focused. Tab and Ctrl/Cmd shortcuts still work normally, and Escape releases the box.

Last 10 keys

No keys captured yet.

⚡

Quick Examples

Typical inputs and the results this tool produces.

event.key
Enter key
event.key === 'Enter'
event.key
Space bar
event.key === ' '
Modifiers
Ctrl + Shift + S
event.ctrlKey && event.shiftKey && event.code === 'KeyS'
Legacy
Left arrow
event.keyCode === 37 // deprecated
📖

Overview

Keycode Info shows what the browser reports for every key you press: event.key (the character or name), event.code (the physical key), the deprecated keyCode and which numbers, the location (standard, left, right or numpad), the modifier keys held and whether the press is an auto-repeat.

Developers use it to write keyboard shortcuts, game controls and form handlers without guessing values. Each key comes with ready-to-paste conditions such as event.key === 'Enter'. Keys are captured only while the box is focused, so normal shortcuts on the rest of the page keep working. Press Escape to leave the box, and Tab still moves focus on.

Why use this tool?

  • Get the exact event.key and event.code for any key
  • Copy a ready-made if or switch condition
  • Tell physical keys (code) from typed characters (key)
  • Keyboard accessible: Escape and Tab always leave the box
⭐

Features

⌨️

Live key details

key, code, keyCode, which, location, modifiers, repeat and isComposing for every press.

📋

Copy-ready snippets

Conditions for key, code, switch cases and held modifiers, one click each.

⚠️

Deprecated flags

keyCode and which are marked as deprecated so you pick the modern properties.

🕘

Last 10 keys

A short history table to compare how different keys report.

♿

No keyboard trap

Escape releases the box, Tab moves on, Ctrl and Cmd shortcuts still work.

🔒

Stays local

Key presses are read in your browser and never sent anywhere.

🛠️

How to Use

1

Focus the box

Click the capture area, or Tab to it. The border turns blue when it is listening.

2

Press a key

Press any key or combination. Its details appear at once.

3

Copy a snippet

Choose the condition you need and press Copy to paste it into your code.

4

Leave the box

Press Escape or Tab to return to normal page keyboard use.

🤔

Frequently Asked Questions