Test your keyboard and read key codes in the browser
Press keys in the box below to see exactly what your browser receives. It is a quick way to find a dead key, check a new keyboard layout, or learn the difference between key and code in JavaScript.
Press any key
Some shortcuts never reach a web page because the operating system or the browser takes them first, such as Alt + Tab, Ctrl + W or the Windows key on its own. A missing result for those keys does not mean the key is broken.
key versus code
Every keyboard event carries two names, and they answer different questions:
| Property | Answers | Press Q on a US layout | Same key on a French AZERTY layout |
|---|---|---|---|
event.key | What character or action did the user mean? | q | a |
event.code | Which physical key was pressed? | KeyQ | KeyQ |
Use key for text and shortcuts that depend on a letter, such as Ctrl + S. Use code when position matters more than the letter, such as W A S D movement in a game, so players with other layouts get the same hand position. The older keyCode number is deprecated, and new code should not rely on it.
The location value separates duplicates: 1 means the left key and 2 the right one for Shift, Ctrl and Alt, and 3 means the number pad. So the tester tells left and right Shift apart.
A systematic key check
- Click into the box above and press Reset.
- Work along each row from left to right, pressing every key once.
- Watch the counter of different physical keys go up by one each time.
- If a press does not change the readout, press it again more firmly and then once from a different angle.
- Hold a key down. You should see “auto-repeat: yes” after a short delay.
- Test the modifier keys on both sides, and the number pad with Num Lock on and off.
What different faults look like
| Symptom | Likely cause | What to try |
|---|---|---|
| A key never registers | Dirt under the key, a failed switch, or a remapping tool | Test in another app, then clean with compressed air with the keyboard unplugged |
| One press types the letter twice | Switch chatter, common on worn mechanical switches | Clean or replace the switch; some keyboards offer a debounce setting |
| A key keeps repeating on its own | A stuck key or a sticky spill | Unplug, then free and clean the key |
| Wrong characters appear | The operating system keyboard layout does not match the keyboard | Check the input language setting |
| Some keys fail only in combinations | Ghosting or a rollover limit | See the next section |
Ghosting and rollover
Keyboards wire keys in a grid of rows and columns. When several keys are held at once, cheaper designs cannot always tell which ones are down, so some presses vanish. This is called ghosting or blocking. Key rollover describes how many simultaneous keys a keyboard reports correctly; “n-key rollover” means every key. To test it, click in the box, hold Shift, then add keys one at a time and watch which new presses appear.
Laptop-specific checks
- The Fn key is usually handled inside the keyboard and sends no event of its own.
- Media and brightness keys may be handled by the system and never reach the page.
- If a laptop key fails, check whether an external keyboard works before you assume a hardware fault.
Questions
Does this page record what I type?
No. The tester shows the last key event and a list of physical key codes you have pressed. Nothing leaves your browser, and a reload clears it.
Why does Space show as a quoted space?
The key value for the space bar is a single space character, which would be invisible, so the tester labels it.