Skip to content
Run here 100% in your browser, no upload, no login

Keycode Lookup

Press any key to see event.key, event.code, keyCode and modifier states in real time.

Press any key on this page

?

event.key

—

event.code

—

event.keyCode

—

Modifiers Ctrl Alt Shift Meta

Test inside an input

Recent keys

How to use it

  1. Click anywhere on the page so the browser focuses it, then press any key.
  2. The large tile shows event.key; the cards show event.code, the legacy event.keyCode and so on.
  3. The modifier chips light up for Ctrl, Alt, Shift and Meta as you hold them.
  4. Typing inside the test input also fires the listener — handy for checking how inputs see keys.
  5. The history list keeps the last eight key presses for comparison.

Common use cases

Why it stays private

The listener is a local event handler; keystrokes are displayed and discarded in memory. Nothing is logged or transmitted — though as a matter of hygiene, avoid typing real passwords while testing.

FAQ

Q: Why do key and code differ? A: event.key is the character produced (layout-dependent), while event.code is the physical key position (layout-independent). For shortcuts, prefer code so KeyZ stays Ctrl+Z on AZERTY too.

Q: Is keyCode deprecated? A: Yes — keydown and keyup should use key or code. The legacy number is shown because old code and cheat sheets still reference it, and matching it saves a web search.

Q: Why did my arrow keys scroll the page? A: The tool only listens; it does not block default behavior, so arrows and Tab keep working normally. For shortcut code you write yourself, call preventDefault() when you handle the key.

Your data stays on this device

Keycode Lookup runs 100% locally. Everything you paste or drop is processed by your own browser and never transmitted. Nothing is stored on our servers — close the tab and it is gone.

Nothing you type is sent to a server, logged, or used for analytics. The page works even with your network disconnected after first load.