JavaScript Keycode: Code of Any Key Pressed
Press a key to get its JavaScript key, code, keyCode and modifiers.
Press any key…
🔒 100% client-side — no data sent
Press a key and instantly get its JavaScript key, code, keyCode and which values. Perfect for coding keyboard shortcuts and event listeners. Everything happens in the browser; no keystroke is logged online.
What is it for?
- ▸ Find a key's code for a keyboard shortcut
- ▸ Debug a keydown or keyup event listener
- ▸ Compare key, code and keyCode for the same key
- ▸ Identify special keys (Enter, Escape, arrows)
FAQ
Difference between key, code and keyCode?
key gives the produced character, code identifies the physical key regardless of layout, keyCode is a deprecated numeric value.
Is keyCode still usable?
It still works but is deprecated; prefer key or code for modern code.
Are my keystrokes logged?
No, everything stays local in your browser.
Related tools
Basic Auth · header generator Generate the HTTP Authorization: Basic header from a username and password. Bearer · Authorization header Generate the HTTP Authorization: Bearer header and extract a token from a header. Code playground (JS/TS/Python/PHP) Run JavaScript, TypeScript, Python or PHP and see the result instantly, 100% in your browser. Color shades Generate the tints and shades of a color for your palette, in your browser. Cookie · parser Break down a Cookie or Set-Cookie header into readable key/value pairs. CORS headers · builder Generate CORS headers (Access-Control-Allow-*) for your server.