Keycode Info screenshot

Keycode Info

Press a key and read its key, code, keyCode and modifier state, announced in a live region. Nothing you type is stored.

Privacy First
0 Runs
Updated 2026-11-07
Runs in your browser
No upload
No account needed
Nothing is stored

What the browser reports for a keypress

Three different identifiers come out of a single keypress, and they do not mean the same thing. key is the character or named key the press produced, so it changes with the keyboard layout and with Shift. code names the physical key on the keyboard, so it stays the same when the layout changes. keyCode is the legacy numeric value older pages still test, and it is the one that differs most between browsers.

Reading the display

Press any key after focusing the panel. The grid fills in with the three identifiers and with the four modifier flags held at that moment: Alt, Ctrl, Meta and Shift. A live region announces the last key in a sentence, so a screen reader reads the change without you having to hunt for it. The Clear button empties the grid and resets the announcement.

Why the difference matters

If you are writing a keyboard shortcut, code is usually the right identifier for a physical key such as the left bracket, while key is right when the character matters. A page that tests keyCode is testing a number the modern event model deprecates. Seeing all three side by side is the quickest way to tell which one a handler is actually receiving.

What it does not do

It does not record a sequence, save a shortcut or send anything anywhere. The page adds one listener and writes the values into the grid; there is no log, no storage and no request. It also does not describe how a particular operating system or assistive technology maps a key — it reports what your browser received.

Press a key and the page reports what the browser received: key is the character or named key produced, code is the physical key, and keyCode is the legacy number older pages still test. The four modifier flags are read at the moment of the press.

A live region announces the last key in a sentence, so a screen reader reads the change without hunting for it. Clear empties the grid and resets the announcement.

It reports one press at a time. It does not record a sequence, save a shortcut or describe how an operating system or assistive technology maps a key; it says what this browser delivered.

The three identifiers

key changes with the layout and with Shift, so it is the right value when the character matters. code names the physical key and stays stable across layouts, which is why a shortcut bound to a bracket usually tests code rather than key.

keyCode is deprecated in the modern event model but still appears in older handlers. Seeing all three side by side is the quickest way to tell which one a handler is actually receiving.

  • key, code and keyCode per press
  • Alt, Ctrl, Meta and Shift state
  • A live region announcement

What it deliberately ignores

A press inside a text field is not captured, so typing in the page's own controls does not overwrite the grid. The page adds one listener and writes values into it; there is no log, no storage and no request.

It cannot tell you what a key does in another application or on another platform. A shortcut that works here may be intercepted by the browser or the operating system before a page sees it.

How to use the key grid

Focus the inspector panel and press the key once; the grid shows its key, code and keyCode with the Alt, Ctrl, Meta and Shift flags as they were at that moment, and the live region announces the press in a sentence. Hold the modifiers during the press when the shortcut under test needs them.

Press Clear to empty the grid and reset the announcement before the next test. Keep presses one at a time and outside text fields, since the page captures neither sequences nor typing in its own controls.

What to Expect

Best for

  • Debugging which identifier a key handler receives
  • Choosing between key and code for a shortcut
  • Seeing the modifier state at the moment of a press

Not ideal for

  • Recording a sequence of keys
  • Testing an operating-system or application shortcut
  • Saving a keymap

What this tool keeps

  • The three identifiers of the last press
  • The modifier flags held at that moment
  • A sentence announcing the key for a screen reader

What may need cleanup

  • The keyCode value, which browsers may differ on
  • A key intercepted before the page sees it
  • A sequence, which has to be pressed one key at a time

Common errors

  • Pressing keys inside a text field and finding nothing captured
  • Reading key as the physical key when it is the produced character
  • Expecting a shortcut recorder

Example use cases

  • Writing a keyboard shortcut handler
  • Checking a layout-dependent key
  • Teaching the difference between key and code

Sample input

A press of the left bracket with Shift held, after focusing the inspector panel.

Sample output

The key reported as an opening brace, the code as BracketLeft, the legacy number, and Shift marked true in the grid and the live sentence.

Who this is for

  • Front-end developers
  • Accessibility testers
  • Students learning keyboard events

Frequently asked questions

What does the keycode page report for a key press?

key, the character or named key produced; code, the physical key; and keyCode, the legacy number, with the four modifier flags at that moment.

Can I record a sequence of keys?

No. It reports the last press only, one key at a time.

Are keyCode values the same in every browser?

No. Browsers may differ on the legacy value, so treat it as a compatibility hint rather than a fact.

Developer program

Build custom tools for your store

Join the SDK program to create useful ecommerce utilities for your store.