HP Keyboard Typing Letters by Itself? How to Fix It
Your HP keyboard starts typing letters on its own the moment the PC starts. That is almost always a stuck key, moisture in the keyboard, or a failing keyboard. The first test takes two minutes: find out whether it happens before Windows loads, because that splits hardware from software.
Your HP keyboard starts typing letters by itself the moment the PC starts. That is almost always a stuck key, moisture in the keyboard, or a failing keyboard circuit. It is rarely a virus. The pattern of the typing tells you the cause, and one two-minute test splits the problem in half: does it happen before Windows loads, or only after? Work through the steps below in order, and stop as soon as the typing stops.

Read the pattern first
Open Notepad, take your hands off the keyboard, and watch. Do not touch anything for a full minute.
One letter repeating endlessly, the same character over and over, means a physically stuck key, dirt under that key, or a failed switch for that key. Random letters appearing with no pattern points at software, a failing keyboard controller, or moisture shorting the keyboard matrix. Whole words, opening windows, or a moving pointer suggest software injecting input, a remote-access tool, or malware. Shortcuts firing on their own, like the Start menu opening by itself, mean a modifier key is stuck: Shift, Ctrl, Alt, or the Windows key.
The pattern matters more than the word ghost typing. Write down which letters appear and whether they repeat. That is the first thing a repair shop will ask, and it decides which steps below apply to you.
The two-minute test: hardware or software
The question that decides everything is whether the typing happens before the operating system loads. Restart the PC and watch the sign-in screen. If letters appear while you are at the password prompt, before you have logged in, the cause is hardware. Windows settings, drivers, and startup apps have not loaded yet, so none of them can be typing.
If you can, test earlier still. Restart and press the key that opens the BIOS or UEFI setup, usually Escape or F10 on an HP. If characters appear in the BIOS screen, the fault is definitely hardware, because no operating system is running at all.
If the typing starts only after you log in, the cause is software: accessibility settings, a driver, a startup utility, or malware. Skip to the software steps. If it happens before login, stay with the hardware steps.
First, stop entering passwords
Until the cause is clear, avoid logging into banking, email, password managers, or any important account on the affected PC. A keyboard typing on its own can send keystrokes into a password field, and if the cause turns out to be remote access or malware, anything you type is exposed.
Hardware step 1: disconnect everything external
Unplug every USB keyboard, USB receiver, docking station, game controller, and macro pad. Turn off Bluetooth and remove any Bluetooth keyboard from the room. Then restart the PC and watch.
External devices are a common cause of phantom typing, especially a wireless keyboard with low batteries or a receiver sitting next to other USB devices. If the typing stops with everything unplugged, reconnect one device at a time and restart after each one. The device that brings the typing back is the culprit.
If the typing continues with nothing external connected, the built-in keyboard is the suspect.
Hardware step 2: find the stuck key
Look closely at the keyboard. A stuck key is often visible: a key sitting lower than its neighbours, tilted to one side, or shiny with use.
Clean around the suspect key with short bursts of compressed air, holding the can upright. On a desktop HP keyboard you can carefully pop the keycap off and clean underneath. On a laptop keyboard, do not force the keycap off. Laptop keycaps are held by tiny plastic scissor clips that snap easily, and a broken clip means a new keyboard. Compressed air and a gentle wipe around the key are the safe limits for a laptop.
If liquid was spilled on the keyboard, stop. Shut the laptop down immediately, unplug it, and do not power it on again. Liquid inside a keyboard causes corrosion that spreads while the machine is powered. Let it dry for at least 48 hours with the lid open and the keyboard facing down, then take it to a repair shop for inspection. Continued testing on a wet keyboard makes the damage worse.
Hardware step 3: test with an external keyboard
Plug in a basic wired USB keyboard and restart. If the USB keyboard works normally while the built-in keyboard keeps typing on its own, the built-in keyboard, its ribbon cable, or its connector is the leading suspect. If the USB keyboard types by itself too, the problem is software on the computer, not the keyboard.
A swollen battery can also cause this fault on a laptop. A battery swelling inside the case presses up against the keyboard from underneath and squeezes the membrane contacts together. If the bottom case bulges, the trackpad clicks oddly, or the typing gets worse as the laptop heats up, stop using the laptop and take it to a repair shop. A swollen battery is a fire risk.
Software step 1: turn off accessibility features
Open Settings, then Accessibility, then Keyboard, and turn off Sticky Keys, Filter Keys, and Toggle Keys. These features change how the keyboard behaves, and a Sticky Keys shortcut triggered by accident can make the keyboard seem possessed. Restart and test.
Then check the keyboard layout. Open Settings, then Time and Language, then Language and Region, and confirm the layout matches your physical keyboard. A wrong layout does not type on its own, but it makes typed characters come out wrong, which is easy to confuse with phantom typing.
Software step 2: reinstall the driver and test in Safe Mode
Open Device Manager, expand Keyboards, right-click the HP keyboard, and choose Uninstall device. Restart the PC and Windows reinstalls the driver automatically.
If it continues, boot into Safe Mode, which loads Windows with no startup apps and a minimal driver set. If the typing stops in Safe Mode, a startup app or service is injecting the keystrokes. Open Task Manager, go to the Startup tab, and disable startup items one at a time, restarting after each one, until the typing stops. The last item you disabled is the cause.
If the typing continues in Safe Mode with the built-in keyboard disabled and an external keyboard attached, run a full malware scan with Windows Defender and a second opinion scanner. Coherent words, moving windows, or a moving pointer alongside the typing are the signs that make a scan worth doing. A single repeating letter is almost never malware.
When the keyboard needs replacing
If the typing happens before Windows loads, continues with all externals unplugged, and stops only when the built-in keyboard is disabled, the built-in keyboard has failed. The membrane or the controller board is shorting, and no amount of cleaning or driver work will fix it. The repair is a keyboard replacement. Get a quote with your exact model number, because HP laptop keyboards are model specific. For another HP keyboard fault, see our guide to HP EliteBook x360 keyboard keys not working.
FAQ
Why does my HP keyboard type letters by itself when I start the PC? The most common cause is a stuck key, dirt or moisture under a key, or a failing keyboard. If the typing happens before Windows loads, it is hardware. If it starts only after login, it is software: accessibility settings, a driver, a startup app, or malware.
How do I tell if ghost typing is hardware or software? Watch the sign-in screen. Letters appearing before you log in mean hardware, because Windows settings and startup apps have not loaded yet. Typing that starts only after login means software. Testing in the BIOS setup screen settles it completely.
Can a virus make my keyboard type by itself? It is rare. The vast majority of cases are a stuck key or moisture. Run a malware scan if whole words appear, windows move on their own, or the typing continues with the keyboard disconnected. A single repeating letter is almost never malware.
My HP laptop keyboard types by itself when the laptop gets hot. Why? Heat expands the plastic membrane and can press the contacts together, or a swelling battery is pressing on the keyboard from underneath. Clean the air vents and use the laptop on a hard surface. If the case bulges, stop using it and take it to a repair shop.