Keyboard typing the wrong characters
Your system is using a different keyboard layout than the one printed on your keys; switch the layout in your language and keyboard settings.
Page updated November 26, 2026.
What is going on
A keyboard is just a grid of physical keys. Your operating system decides which character each key produces. If the layout is set to US but your keyboard is a UK model, the @ and " keys swap places, and # and \ move too. If the layout is set to an international or other language layout, accents and symbols turn up in unexpected spots. A French AZERTY keyboard set to US types a Q where an A is printed, which is a classic example, but the same thing happens between any two layouts.
Start with a quick test
Open the keyboard test. It lights up the physical key you press and shows its technical code, regardless of the character your system types. If the right key lights up but the wrong character appears in a document, the layout is the problem, not the keyboard.
Common symptoms
- @ and " are swapped: US layout on a UK keyboard, or the reverse.
- # or \ gives a different symbol: the same pair of layouts again.
- Letters are rearranged: a QWERTY, AZERTY or QWERTZ mismatch.
- Accents or dead keys appear: an international layout with dead keys, where a quote mark waits for the next letter.
Fix it on Windows
1. Open Settings > Time & language > Language & region (Windows 11). 2. Select the ellipsis next to your display language and choose Language options. 3. Under Keyboards, add the layout that matches your keyboard, and remove the one you do not want. On Windows 10, the path is Settings > Time & language > Language. To switch quickly, press the Windows key + Space, or use the input icon in the taskbar. If you never meant to change it, you may have pressed that shortcut by accident.
Fix it on macOS
Open System Settings > Keyboard, go to Text Input and click Edit. Add or remove input sources there. Once more than one source is installed, an Input menu appears in the menu bar, and Control-Space returns to the source you used last.
Other things to check
- Is the language shown in the taskbar or menu bar the one you expect?
- Did a shortcut switch the layout?
- Is a game or remapping tool changing keys?
- On a remote desktop or virtual machine, the remote computer may use its own layout.
Menu names change between versions, so use the search box in Settings if you cannot find an item.
If nothing works
If the wrong character appears on only one key and the test shows nothing lights up, read keyboard key not working. If you are about to take the typing test, pick the layout that matches your keyboard first, since its texts include punctuation.
Sources and updates
- Microsoft, Manage the language and keyboard/input layout settings in Windows: Windows 11 and 10 menu paths, Windows key + Space shortcut (read Nov 26, 2026).
- Apple, Write in another language on Mac: System Settings > Keyboard > Text Input > Edit, Input menu and Control-Space (read Nov 26, 2026).
- MDN, KeyboardEvent.code: the code names the physical key, whatever the layout.
Page checked on November 26, 2026. Spotted an error? Tell us on the contact page.
Frequently asked questions
Why are @ and " swapped on my keyboard?
That usually means a US layout is active on a UK keyboard, or the other way around. Add the matching layout in your language settings and remove the other.
How do I switch keyboard layouts fast on Windows?
Press the Windows key and the Space bar together. Each press cycles through the installed layouts.
Does the keyboard test work with any layout?
Yes. It reads the physical key position, so you can compare it with what your system types.
Run the test
- Keyboard testerVisual QWERTY or AZERTY keyboard, simultaneous keys and keys never pressed.
- Typing testWords per minute and accuracy, with English texts.
Related questions
Related guides
- How to clean a keyboard without damaging it
- How to type faster: 6 steps to a higher WPM
- How to troubleshoot a device that won't work