JavaScript Key Code Finder

Find the JavaScript event key, code, and which value for any key you press.

-
event.key
Press any key
event.code
-

Press any key on your keyboard to see its value.

Your data stays in your browser
Recommended Reading

Recommended Books on JavaScript & Web Development

As an Amazon Associate we earn from qualifying purchases.

How do you like this tool?

Tutorial

How to use

1
1

Usage Step

Find the JavaScript event key, code, and which value for any key you press.

Use Cases

Use cases

Example Case

"JavaScript Key Code Finder"

Boost Your Capabilities

Professional Products to Boost Your Development Setup

As an Amazon Associate we earn from qualifying purchases.

Frequently Asked Questions

?What is a JavaScript key code?

A JavaScript key code is a numeric or string value associated with a keyboard event. It helps developers identify which key was pressed. This tool shows the event.key, event.code, and legacy event.which values instantly.

?How do I find the keyCode for any key?

Simply press any key on your keyboard while using this tool. The JavaScript Key Code Finder will immediately display the key, code, and which values for the pressed key.

?Is this key code finder free and private?

Yes, this tool is completely free and runs 100% in your browser. No data is sent to any server, so your keyboard inputs remain entirely private.

?What is the difference between event.key, event.code, and event.which?

event.key returns the character or key name (e.g., 'a', 'Enter'), event.code returns the physical key location on the keyboard (e.g., 'KeyA', 'ArrowUp'), and event.which is a deprecated numeric code maintained for backward compatibility.

?Is event.keyCode deprecated in JavaScript?

Yes, event.keyCode and event.which are considered deprecated. Modern browsers recommend using event.key or event.code instead. This tool displays all values so you can migrate legacy code confidently.

?Can I use this tool for game development key bindings?

Absolutely. Game developers frequently use this tool to identify the correct event.code values for mapping keyboard controls, since event.code represents the physical key position regardless of keyboard layout.

?Does this tool work with special keys like F1-F12, Ctrl, or Alt?

Yes, the tool captures events for all keyboard keys including function keys, modifier keys (Ctrl, Alt, Shift, Meta), arrow keys, and special keys like Escape and Tab.

Related Tools

Newsletter

Get Free Productivity Tips & New Tools First

Join makers and developers who care about privacy. Every issue: new tool drops, productivity hacks, and insider updates — no spam, ever.

Priority access to new tools
Unsubscribe anytime, no questions asked