Click the keyboard below to start, then press keys. While it is active, Space, Tab, the arrow keys and other keys that would scroll the page are kept inside the test. Press Esc or click anywhere else to leave. On a narrow screen, scroll the keyboard sideways.
Held keys: none
Other keys seen (not on the map above): none
About this tool
This keyboard tester draws a full-size US (ANSI) keyboard and lights up each key as you press it. A key you have pressed stays marked as tested, so you can work across the board and see at a glance which keys have not responded. For each press it shows the values the browser reports, event.key, event.code, the key location and the repeat flag, and it counts how many keys are held down at once so you can check key rollover. Everything runs in your browser; no key presses are sent anywhere.
How to test a keyboard
- Choose a layout. Full-size has 104 keys including the number pad. Pick Tenkeyless for keyboards and most laptops without a number pad, so the count only includes keys you have.
- Click the keyboard map or press Start testing. The map gets a highlighted border while it is listening.
- Press every key once. Each key lights while held and stays marked afterwards. The counter shows keys tested out of the total.
- Look for problems. A key that never lights may be dead or intercepted (see below). A key that lights without being pressed, or stays lit after you let go, may be stuck. A key that logs two presses for one touch may be chattering.
- Test rollover by holding keys down one after another and watching Held now and Most held at once.
- Press Esc or click elsewhere to leave the test, and Copy untested keys if you want a list of keys still unmarked.
How it works: event.key and event.code
When you press a key the browser fires a keydown event, and a keyup event when you release it. This page reads two properties from each event. According to MDN, KeyboardEvent.code represents the physical key and is not altered by the keyboard layout or modifier keys, while KeyboardEvent.key is the value the key produces, such as a character. The map above uses code, so it marks the right key even if your system uses a different layout.
| You press | event.key | event.code |
|---|---|---|
| Q on a US QWERTY layout | q | KeyQ |
| Shift and Q | Q | KeyQ |
| The same physical key on a French AZERTY layout | a | KeyQ |
| Space bar | " " (a space) | Space |
| Right Shift | Shift | ShiftRight |
| 7 on the number pad with Num Lock on | 7 | Numpad7 |
The location value tells keys with the same meaning apart: 0 is standard, 1 is the left-hand version (left Shift, Ctrl, Alt or Meta), 2 is the right-hand version, and 3 is the number pad. The repeat flag is true when the event comes from the key being held down long enough for your system's auto-repeat to start, rather than from a new press.
Key rollover and ghosting
Key rollover is the number of keys a keyboard can report correctly when they are held at the same time. "N-key rollover" (NKRO) means any number of keys can be held and each one is still reported. Many keyboards wire their switches in a grid, or matrix. Without a diode on each switch, some combinations of three or more keys can make the keyboard detect a key that is not pressed, called a ghost key. Keyboards avoid this by blocking extra keys in those combinations, so a key you press does not register at all.
The USB connection can be a limit too. In the USB HID specification, the simple boot keyboard report has one byte for modifier keys and room for six other key codes; when more keys are pressed than the report can hold, the keyboard reports an error state instead of the keys (see USB-IF HID specifications, Device Class Definition for HID 1.11, Appendices B and C). Many keyboards can report more keys in their normal mode.
To test, hold keys one at a time without letting go, for example A, S, D, F, J, K and L, then add Shift and Ctrl. If a newly pressed key does not light, you have reached the limit for that combination. Try several different combinations, because blocking often depends on which keys share wiring. Avoid holding shortcuts your browser or system acts on, such as Ctrl+W or Cmd+Q, which a web page cannot block.
Keys a browser may not see
A web page only receives the key events the operating system and browser pass on. A key that does not light here is not necessarily broken:
- Fn is usually handled inside the keyboard or by the computer's firmware. MDN's code values table notes that for the Mac Fn key no event is actually fired, so it is not on this map.
- Windows key and Cmd. MDN notes that some operating systems may intercept the Meta key so it is never detected.
- Print Screen, media keys and Fn-layer keys such as brightness or volume may be taken by the system, may reach the page under a different code, or may only send a key-up event. This page marks a key as tested when either its key-down or its key-up arrives, and lists codes it does not recognize under Other keys seen.
Stuck keys and chatter
A stuck key keeps reporting as held: it stays lit, and if your system auto-repeats it the repeat flag turns true and the log fills with repeats. Chatter, or double typing, is when one press registers twice. Watch Same key again after: it shows the time in milliseconds since the previous press of the same key. If one deliberate press is followed by a second press only a few tens of milliseconds later, the switch may be chattering. Dirt and debris are a common cause, so cleaning following the manufacturer's advice is worth trying first.
Laptop and Mac keyboards
Laptop keyboards usually have no number pad and put keys such as Home, End, Page Up and Page Down on an Fn layer, so choose the Tenkeyless layout and test those keys with Fn held. On a Mac, MDN documents that the Command key is reported as MetaLeft or MetaRight with event.key Meta, and the Option key as AltLeft or AltRight with event.key Alt. So on this map, Cmd lights the key labelled Win/Cmd and Option lights Alt. Mac keyboards do not have every key shown on the full-size map, such as Print Screen, so untested keys there are expected.
Common mistakes
- Testing with the page not focused. Key presses only count while the keyboard map is active; it has a highlighted border.
- Reading a non-US layout as a fault. The labels are US ANSI. On other layouts, keys are still matched by physical position.
- Blaming the keyboard for missing Fn or Windows keys. These may be intercepted before the browser.
- Holding browser shortcuts. Combinations such as Ctrl+W can close the tab.
Use cases
Use the tester when buying a second-hand keyboard or laptop, after spilling something on a keyboard, when a key starts double typing, to compare rollover between keyboards for gaming, or as a developer to see exactly which key and code values a key sends. For mouse buttons, the CPS Test counts clicks and can reveal a double-clicking switch. To check your display, use the Dead Pixel Test and the Screen Resolution Checker, and for characters that are not on your keyboard see Special Characters.
Frequently asked questions
This page is designed for physical keyboards. A Bluetooth or USB keyboard connected to a phone or tablet works once you tap the keyboard map. The on-screen touch keyboard usually does not open for this test area, and virtual keyboards may report key values differently from a physical one.
The map matches keys by physical position using event.code, while the character comes from event.key and depends on the keyboard layout chosen in your operating system. If the key lights in the right place but the event.key value is unexpected, check your system input language and layout settings rather than the hardware.
Hold down as many keys as you can, in several different combinations, and watch the Most held at once value. If every key you press keeps lighting, the keyboard reports at least that many keys together. Check the manufacturer specifications too, because some keyboards offer NKRO only in a particular mode or over a wired connection.
Some keys are often intercepted by the operating system or are missing from your keyboard, such as the Windows key, Print Screen, Pause, or the number pad on compact boards. Choose the Tenkeyless layout if you have no number pad, and use Copy untested keys to see exactly which keys are still unmarked.
No. Key presses are only used to update the map, the counters and the event log on this page, and nothing is uploaded or saved. Reset clears everything, and closing the tab discards it. Still, avoid typing passwords or other private text into any test page.
Some keys and input methods do not map to a standard code value, so the browser reports an empty code or a key of Unidentified. This is common with special function keys, some media keys and some virtual keyboards. Such presses appear under Other keys seen so you can still tell that something arrived.