Quick Answer
Open the Keyboard Tester, which shows exactly which physical key you pressed alongside which character your system registered. In the vast majority of cases, wrong letters come from a keyboard layout mismatch (like a QWERTY keyboard set to a QWERTZ or AZERTY layout in your OS), not a hardware fault - and this test makes that mismatch immediately obvious.
Why This Is Almost Always a Layout Issue, Not a Broken Key
A physical key switch either makes contact or it doesn't - it has no way to "know" it should send a Z instead of a Y from a hardware standpoint. The letter that appears on screen is entirely up to your operating system's keyboard layout setting, which maps each physical key position to a specific character. When someone says "I press Y and get Z," what's essentially always happening is that the OS is interpreting key positions according to a different layout than the one printed on the keycaps, most commonly QWERTY keycaps being read under a QWERTZ layout (common in parts of Europe), where the Y and Z positions are swapped compared to QWERTY.
What to Do If You Genuinely Need Two Layouts Available
Some people legitimately need to switch between layouts regularly - for example, typing in both English and a language that uses a different physical layout convention. In that case the goal isn't to remove the second layout entirely, but to make sure you know which one is active at any given moment and can switch deliberately (usually via a keyboard shortcut like Windows key + Space on Windows). Wrong letters that appear only occasionally, rather than consistently, often mean an accidental layout switch happened without you noticing, which is a slightly different scenario from a keyboard permanently stuck on the wrong layout.
Step-by-Step: Diagnosing the Cause
- Open the Keyboard Tester and press the specific key that's producing the wrong letter, noting exactly what shows up.
- Check your OS's currently active keyboard layout (Language & Region settings on Windows, Keyboard settings on macOS) and compare it against what's actually printed on your keycaps.
- If the layout matches what's printed, temporarily switch to a different, known layout and back, since layout settings occasionally get stuck or corrupted and a reset can resolve it.
- Test the same key with a different keyboard connected to the same computer. If the wrong letter still appears with a different keyboard, the issue is definitely in the OS layout setting rather than any specific keyboard's hardware.
- If a different keyboard types correctly but the original one doesn't, check whether that specific keyboard has its own onboard layout switching (some keyboards have a physical Fn combination to switch between regional layouts independent of the OS).
How to Interpret the Results
- Wrong letter appears consistently and matches a known alternate layout pattern (like Y/Z swapped) - this is a keyboard layout setting mismatch, fixed entirely in software with no hardware involved.
- Wrong letter is inconsistent, not matching any recognizable layout pattern - less common, and worth checking for a genuinely faulty key sending an incorrect scan code, though this is rare compared to layout issues.
- Problem follows the keyboard to a different computer, but a different keyboard on your original computer types correctly - points toward that specific keyboard's onboard layout switching or firmware rather than your OS.
Fixing a Layout Mismatch
On Windows, this is fixed under Settings → Time & Language → Language & Region, where you can add, remove, and set the default input layout to match your physical keyboard. On macOS, it's under System Settings → Keyboard → Input Sources. The fix is almost always simply selecting the layout that matches your keycap labeling (typically "English (US)" or "QWERTY" for standard US-layout keyboards) and removing or deprioritizing any conflicting layout that may have been added accidentally, which sometimes happens after installing certain software or connecting a keyboard that auto-suggested a different regional layout.
FAQ
Can this happen after a Windows or macOS update?
Yes - system updates occasionally reset or change the default keyboard layout, which is one of the more
common triggers for this issue appearing seemingly out of nowhere.
Is it ever actually a hardware problem?
Rarely, but it's not impossible - a genuinely faulty switch sending an incorrect signal is uncommon compared
to a layout mismatch, which explains the vast majority of real-world cases people run into.
Why would my keyboard default to a different layout in the first place?
Often it's simply the OS's regional or language settings, which can default to a locale-specific layout during
setup that doesn't match the physical keyboard actually plugged in, especially with imported or
regionally-purchased hardware.
Does this affect number keys or only letters?
It can affect both, along with punctuation, since a keyboard layout remaps the entire key set, not just
letters - which is why testing multiple keys, not just the one that first caught your attention, helps
confirm the pattern.