Keyboard Key Code Viewer

Find the exact event.key and event.code values a key produces without writing a test page.

Press any key…

Reading the values

event.code describes the physical key position (KeyA, Digit1), while event.key is the character it produced. keyCode is deprecated but still used by older code.

Frequently asked questions

Layout dependent?

event.key changes with layout; event.code stays physical.

Mobile keyboards?

Virtual keyboards may report keyCode 0.

Repeat keydown?

Hold a key and the last values stay shown.