Skip to content
Zoyku

Keycode Info

Press any key to see its event.key, event.code and legacy keyCode live, plus modifier state and a history of your last 10 keystrokes.

event.key
—
event.code
—
keyCode
—
ModifiersCtrlAltShiftMeta
Last 10 keys

Waiting for a key press…

Press any key — the values update instantly. Focus stays on the page, no input box needed.

This tool runs entirely in your browser. Your data never leaves your device — it is not uploaded to any server.

How to use

  1. 1Click anywhere on the page so it has keyboard focus, then press any key.
  2. 2Read event.key, event.code and keyCode from the three cards, with Ctrl/Alt/Shift/Meta highlighted when held.
  3. 3Toggle "ignore auto-repeat" to filter held-down key repeats, and check the last-10 table to compare keys.

Keycode Info

Keyboard handling bugs usually come from mixing up the three identifying values a KeyboardEvent offers: event.key is the character produced ("a" or "A" when Shift is held), event.code is the physical key (KeyA regardless of layout), and keyCode is the legacy numeric code that old code still depends on. Pressing keys on this page shows all three side by side, instantly, along with which modifiers were down at that moment.

It also keeps the last 10 keystrokes in a small history table, so you can compare values across keys instead of pressing and forgetting. Useful when wiring up game controls, shortcut listeners, or debugging why a keydown handler fires twice (turn on ignore-repeat to filter auto-repeat).

Frequently asked questions

Why do event.key and event.code show different values for the same key?

event.key reports what the key produces under the current layout and modifier state ("A", "á", "1"), while event.code reports the physical key position (KeyA, Digit1) independent of layout. Shortcuts should generally match on code; text handling should read key.

Is keyCode deprecated?

Yes — it is legacy, kept only for compatibility with old code that still branches on numeric codes like 13 (Enter) or 27 (Escape). New code should use event.key or event.code; this tool shows it so you can map old constants while migrating.

Why does the same value repeat while I hold a key down?

Holding a key makes the OS send repeated keydown events with repeat set to true. Enable "ignore auto-repeat" to display only the initial press; disable it if you need to verify that your handler correctly receives repeat events.

How accurate are the results?

Calculations follow the official definitions — SI conversion factors, NIST constants, or the governing formula shown on the page — and results display to enough significant digits for real-world use.

Can I use it on mobile?

Yes. The interface is responsive and all inputs adapt to touch; the calculation itself runs offline once loaded.

Is this tool free to use?

Yes, completely free — no signup, no subscription, no daily limits, and no watermarks on the output.

Embed this tool

Put this tool on your own site with one line — it runs entirely in the visitor's browser.

<iframe src="https://zoyku.com/en/tools/keycode-info?embed=1" width="100%" height="640" style="border:0;border-radius:16px" title="Zoyku — keycode-info" loading="lazy"></iframe>
100% local processing