Keyboard Tester

Press any key and watch it light up on the visual keyboard below. Perfect for checking stuck keys, broken keys, or verifying that every key on a new or used keyboard works correctly.

Nothing you type here is recorded or transmitted to any server.

Press any key to test it

How It Works

The tool listens to keydown and keyup events on the document. Each event carries an event.code property — a string like "KeyA", "ArrowLeft", or "F5" that identifies the physical key position, independent of language or modifier state. This is why event.code is used rather than event.key: pressing the "A" key on a French AZERTY layout produces event.code = "KeyA" even though event.key = "Q".

Each key in the visual layout has an ID matching its event.code. On keydown, the matching element receives a "key-pressed" class that highlights it. On keyup, the class is removed.

The key history log shows the last 20 keys pressed with both their event.code and event.key values, letting you see exactly what the browser is reporting.

Tab and Backspace have their default browser behaviour prevented to stop accidental navigation away from the page.

Frequently Asked Questions

What can I test with this tool?

You can check that every key registers a signal, diagnose stuck keys (they stay highlighted), verify that modifier keys like Shift, Ctrl, and Alt are detected, and confirm that media and function keys send events to the browser.

Is anything I type recorded?

No. The keyboard events are processed entirely in your browser using JavaScript. Nothing you type is transmitted to any server. The key history is only in page memory and disappears when you close or refresh the tab.

Some keys are missing from the layout — why?

The layout shows a standard US QWERTY 104-key layout. Keys unique to other layouts (e.g. extra keys on ISO keyboards, or media keys on laptop function rows) may not appear visually but will still be logged in the key history when pressed.