A keyboard that types the wrong characters almost always has the wrong input language or layout selected, a stuck modifier key, or a keyboard that has been paired with or connected to the wrong device. Fix the layout first: on Windows press Win + Space to cycle through installed languages, on Mac open System Settings > Keyboard > Input Sources, and on most phones open the keyboard's own settings to check its selected language. If several keys are swapped in the same way (for example pressing Y types Z, or the number row produces symbols), you are looking at a layout mismatch, not a broken keyboard. If only a few keys misbehave, the switch or the physical connection is the more likely culprit. The steps below walk through both causes in order, cheapest and most reversible checks first.

What You'll Need

  • The keyboard itself, connected exactly as you normally use it (wired, wireless dongle, or Bluetooth)
  • Access to the operating system's settings on the affected device
  • A simple text editor or notes app to test what is actually being typed
  • For phones and tablets: about a minute to open the keyboard's language settings
  • Optional: a second keyboard to compare behaviour if the first one keeps misbehaving
  • Optional: a can of compressed air for keys that are sticking or repeating

Step-by-Step

  1. Write down the exact pattern. Open a plain text editor and type each letter, then the number row, then the symbol keys above them. Note which keys produce the wrong character. A whole row or a mirrored pair (Y/Z or a swapped row) points to layout. Random single keys that do nothing, repeat, or produce garbage point to hardware. This note saves you time because it tells you which half of this guide applies.
  2. Confirm the correct language and layout is active. On Windows, look at the language indicator in the taskbar near the clock, or press Win + Space and watch the selection banner. If it shows a language you did not intend, select the right one. On Mac, open System Settings > Keyboard > Input Sources and check which source is listed at the top and whether "Show Input menu in menu bar" is on, which lets you switch from the top bar. Labels and exact wording can differ slightly between versions and regions, so look for the input sources or keyboard language area rather than a single exact phrase.
  3. Check the keyboard layout, not just the language. A device can have English selected as the language while the layout is set to a UK, German, French or other variant. Those layouts move punctuation and swap letters, so an apostrophe becomes a different symbol and a quote key sits somewhere new. On Windows, open Settings > Time & language > Language & region, open the language's options, and check the keyboards listed. Remove any layout you do not use and set the correct one as first in the list.
  4. Test the modifier keys. Press each of Shift, Ctrl, Alt and the Windows key separately and feel whether it returns with a click. Then type a few letters with nothing else held. If everything comes out in capitals, Shift is effectively stuck. On Windows, tapping the Shift key five times can turn on Sticky Keys, which changes how those keys behave; check Settings > Accessibility > Keyboard and turn off Sticky Keys and Filter Keys, since Filter Keys can make typing feel like keys are being ignored.
  5. Check Num Lock and the number pad. If keys on the right-hand pad move the cursor instead of typing numbers, Num Lock is off; press it once. On compact laptops, the number pad often shares keys with letters, so a wrongly toggled Num Lock makes a block of letters type numbers. If a whole block of letter keys produces digits, that is the cause.
  6. Disconnect other keyboards and input devices. A wireless receiver left plugged in, a game controller resting on a key, a second Bluetooth keyboard in a bag, or a macro pad can all send input to the same computer. Unplug or switch off every keyboard except the one you are testing, then try again. On phones, a paired Bluetooth keyboard can keep sending keystrokes even when the on-screen keyboard is showing.
  7. Reconnect the faulty keyboard. For USB, unplug it and try a different port, preferably one directly on the computer rather than through a hub. For a wireless dongle, unplug and reinsert the receiver and check or replace the batteries. For Bluetooth, remove the device from the computer's Bluetooth list and pair it again so a clean connection is rebuilt.
  8. Reboot the device. A restart clears stuck driver state and stuck key-reporting. This sounds trivial but resolves a large share of cases where keys suddenly produce odd characters after an update or after waking from sleep.
  9. Check for auto-correct and text replacement. On phones and tablets, the keyboard app itself may be adding, changing or substituting words through autocorrect, predictive text, or a text-replacement shortcut you set up. Open the keyboard app's settings and look for the autocorrect and text replacement sections. Remove shortcuts that fire on ordinary typing patterns.
  10. Test on another device or with another keyboard. This isolates the fault. If the same keyboard types correctly on a different computer, the problem is software on the original machine. If a known-good keyboard types wrongly on the same machine, the problem is settings or drivers. If a known-good keyboard types correctly, the original keyboard's hardware is at fault.
  11. Reinstall the keyboard driver (Windows only). Open Device Manager, expand Keyboards, right-click the entry and choose Uninstall device, then restart. Windows reinstalls the driver on the next boot. This resets settings but does not delete your files.
  12. Clean between the sticking keys. Switch off and unplug the keyboard. Hold it face down and shake gently, then blow compressed air at an angle across the problem keys in short bursts. On a laptop, do not spray liquid cleaners into the deck; follow the maker's cleaning guidance instead.

Common Mistakes

  • Reinstalling the keyboard or buying a new one before checking the language. Layout mismatches look like hardware failure and are fixed in seconds. Confirm the layout first.
  • Switching the language but not the layout. Two layouts can share the same language name; check which layout is actually attached to the entry.
  • Forgetting that accessibility features change typing. Sticky Keys, Filter Keys and Slow Keys can make keys seem broken when they are behaving as configured.
  • Assuming a Bluetooth keyboard is broken when it is paired to the wrong device. If you own several computers or tablets, check which one is receiving the keystrokes.
  • Cleaning a laptop with sprays or a wet cloth pushed into the key gaps. This can cause real damage. Use air only unless the manufacturer says otherwise.

Tips

  • Keep only one language and one layout installed unless you genuinely need others; fewer entries mean fewer accidental switches.
  • On Windows, remove the layout shortcut you rarely use so a stray key combination cannot flip it mid-typing.
  • Screenshot or note your working language and layout settings, so you can restore them after a system update resets them.
  • If you type in two languages, set the switching shortcut deliberately and practise it once so it becomes familiar.
  • Label the cable or receiver for each keyboard if you use more than one on the same computer.

Troubleshooting

If the language and layout are correct and the pattern is still wrong, work down this list in order. First, if only letter pairs are swapped and nothing else looks wrong, your physical keyboard is not the layout you think it is: a UK layout shows a different set of punctuation positions than a US one, so compare which character actually appears against a layout chart.

Second, if keys repeat uncontrollably, the switch is likely stuck or dirty. Unplug the keyboard, clean it with air, and retest. On a laptop, a repeated key usually means a hardware fault in the key mechanism and is a service job rather than a cleaning job.

Third, if the on-screen keyboard in the operating system types correctly while the physical keyboard does not, the layout is right and the physical keyboard or its connection is the problem. Compare using the on-screen keyboard under Windows accessibility tools; if that input is correct, look at cable, receiver, batteries and switches.

Fourth, if typing works in one app but not another, check that the app is not applying its own shortcut remapping or text substitution. Some apps intercept keys for their own functions.

Fifth, if the problem started right after an update or a settings change, undo the most recent change first rather than reinstalling anything. If you have already reinstalled drivers without success, work back through the layout, accessibility and keyboard-device list again, one item at a time.

Frequently Asked Questions

Why does my keyboard type Z instead of Y?

That is the classic sign of a German-style layout versus a US one, or the reverse. Switch to the correct layout rather than changing the physical keyboard.

Why do some keys type the wrong symbol only when I hold Shift?

The layout is probably wrong for that row. Compare with a layout chart for the exact language variant you have selected.

Why does my keyboard type numbers instead of letters?

Num Lock is on and the number pad is overlapping the letter keys, which is common on compact laptops. Press Num Lock once to turn it off.

Why does my phone keyboard change words I typed correctly?

Autocorrect, predictive text or a text-replacement shortcut is overriding your input. Turn those options off in the keyboard app's settings.

Can a dirty keyboard type the wrong characters?

Dirt usually causes missed presses or repeated letters rather than substituted characters. Substituted characters almost always mean layout or modifier trouble.

Should I reset my whole device to fix this?

No. A factory reset deletes your data and is not needed for a keyboard layout or connection problem. Exhaust the settings and cable checks first.