Keyboard typing wrong symbols or letters
If Shift+2 gives " instead of @, Z and Y have changed places, or letters turn into numbers, the keyboard is almost never broken. The computer is translating the keys with a different layout from the one printed on the keycaps. This guide shows how to recognise the common swaps, change the layout back and confirm with a test whether anything is actually wrong with the hardware.
How a key becomes a character
A keyboard does not send letters. It sends a code for the physical position of the key, and the operating system turns that into a character using the active keyboard layout. The same key position gives @ on a US layout and " on a UK layout, or Q on QWERTY and A on French AZERTY. When the layout chosen in the system differs from the one printed on the keys, symbols and letters come out wrong even though every key works perfectly.
The keycode tester shows both sides: code is the physical key, key is the character the layout produced. If code is right and key is not what you expected, the layout is the cause.
Recognise the common swaps
- @ and " swapped, # gives £: a US keyboard used with a UK layout, or the other way round.
- Z and Y swapped: a German, Swiss or other QWERTZ layout is active.
- A and Q, Z and W swapped, numbers need Shift: a French or Belgian AZERTY layout is active.
- Accents or quotes appear only after the next key: an international layout with dead keys is active, such as US-International. That is how those layouts work, not a fault.
- Letters in another alphabet: an input language such as Russian or Greek is active.
- Letters type numbers on a laptop without a number pad: some laptops place a hidden numeric keypad on letter keys, switched on with Num Lock or Fn.
Switch the layout back
- Windows 11: Settings > Time & language > Language & region. Under your language, open the language options and check the listed keyboards; add the one that matches your keys and remove ones you do not use. The input indicator on the taskbar shows the active layout, and Windows key+Space switches between installed layouts, which is also how they get changed by accident.
- macOS: System Settings > Keyboard, then edit the input sources. Turn on showing the input menu in the menu bar to see which source is active.
- Linux desktops: the keyboard or region settings of your desktop environment list the active layouts.
Remove layouts you never use. With only one layout installed, a stray shortcut cannot switch it.
Num Lock and numbers in the wrong place
- Number pad types arrows or moves the cursor: Num Lock is off. Check its state in the numpad test, which shows whether the pad is sending numbers or navigation keys.
- Letters turn into numbers on a laptop: turn off Num Lock, often with Fn plus a key marked Num Lk or NumLock. The exact key varies by model.
- Top-row numbers type symbols: on AZERTY layouts that is normal; numbers there need Shift. Otherwise check Caps Lock and Shift, and test both Shift keys in the keyboard test in case one is stuck.
When it is a hardware fault
A setting changes many keys in a consistent way. Hardware faults look different:
- a key reports a different physical code from its position in the keycode tester or lights up another key in the keyboard test;
- pressing one key produces two characters or a random one;
- the wrong output stays the same on another computer with the correct layout selected.
Those point to a damaged circuit, often after a spill, or to custom firmware or remapping on the keyboard. Reset the keyboard's own profile or firmware settings if it has them, then retest. For keys that type twice, see keyboard typing double letters; for keys that do nothing, keyboard keys not working.
Mac keyboards on Windows and the other way round
Apple keyboards place some symbols differently and have Command and Option where PC keyboards have Windows and Alt. Used on Windows, keys may work but print different symbols from their labels, and the reverse happens with PC keyboards on a Mac. Choosing the layout that matches the keyboard, where the system offers one, fixes most of it. The Mac keyboard test shows Apple key positions.
Questions
Why does Shift+2 type " instead of @?
A UK layout is active on a US keyboard, or the reverse. Select the layout that matches the keys printed on your keyboard in the language or keyboard settings.
Why are Z and Y swapped on my keyboard?
A QWERTZ layout, such as German, is active. Switch to the layout that matches your keyboard and remove the extra one if you do not need it.
My keyboard types numbers instead of letters. Is it broken?
Usually not. On many laptops Num Lock turns some letter keys into a numeric keypad. Turn Num Lock off, often with Fn plus the Num Lk key.
The keyboard tester shows the wrong layout. Is my keyboard faulty?
No. The keyboard map follows your active layout where the browser shares it, otherwise US labels. What matters is that the key in the right physical position lights up.
Related tests
- Keyboard testPress every key and see which ones register, with ANSI, ISO and Mac layouts.
- Numpad testPress every key on the numeric keypad and see whether it registers, with the Num Lock state shown.
- Mac keyboard testKeyboard test with Mac key names, for MacBook keyboards and the Magic Keyboard.
- Ghosting testHold several keys at once and see which combinations your keyboard can report.
- Chatter testFind keys that type twice: each press timed, repeats too fast for a finger flagged.
- Keycode testerSee the key, code, keyCode, location, modifiers and repeat flag the browser reports for any key.
- Spacebar speed testSee how many times you can press the spacebar in 5 to 60 seconds; held keys do not count.
- Chromebook keyboard testKeyboard test with a Chromebook key map: Search key, top-row keys and the arrows.