Pressing Shift+2 and getting " instead of @, or finding # where £ should be? In most cases the keyboard isn't faulty: Windows is simply using the wrong keyboard layout, usually US instead of UK.
Step 1: Check which layout is active
Look at the input language icon in the system tray area of the taskbar, which Microsoft says displays the currently selected keyboard layout. Select it and a pop-up menu lists the available layouts, so you can choose the right one.
If the icon isn't there, Microsoft says to check that Input Indicator is switched on under Settings > Personalization > Taskbar, in the system icons settings for the notification area.
Microsoft also notes that you can hold down the Windows logo key and press the Spacebar to cycle through installed keyboard layouts. This is often how layouts get switched by accident. If pressing the Spacebar does nothing, only one layout is installed.
Step 2: See which languages and layouts are installed
Select Start > Settings.
Select Time & language > Language & region.
Your installed languages are listed in the Language section.
Step 3: Add the correct keyboard layout
In Language & region, select the three dots (ellipsis) next to your language and choose Language options.
Under Keyboards, check whether the layout you want, such as United Kingdom, is already listed.
If it isn't, select Add a keyboard next to Installed keyboards and pick it from the list.
Choose the layout that matches the keycaps printed on your keyboard. Keyboards sold in the UK normally use the United Kingdom layout, but some gaming keyboards are sold with US-layout keycaps, in which case the US layout is the right match.
Step 4: Remove the layout you don't use
Leaving an unwanted layout installed is the main reason the problem comes back. Go back to Language & region, select the three dots next to the language that contains the unwanted keyboard, choose Language options, then remove that keyboard from the installed keyboards list. If a whole extra language was added, you can remove it from Language & region using the three dots next to it and Remove. Microsoft notes that the Remove option is greyed out for the current Windows display language, so switch display language first if needed.
Other causes to check
Our verdict
Most "wrong character" problems are fixed by switching to the correct layout, usually United Kingdom on UK keyboards, and removing any layout you don't use so the Windows key + Spacebar shortcut can't switch it by accident. If a single key misbehaves on every layout, look at the hardware or remapping software instead.