A hardware keylogger is a small physical device that records every key you press on a keyboard. It usually looks like a short plastic adapter or thumb drive, about one to two inches long. Someone with physical access to a computer plugs the keyboard cable into the keylogger, and then plugs the keylogger into the computer’s USB port, which is the rectangular slot where cables connect.
As you type, the device quietly saves your keystrokes to its own built-in memory. It does not put any program on the computer itself. Later, the person who placed it there comes back, unplugs it, and reads the saved text to find passwords, account numbers, or private messages.
Why it matters
Because a hardware keylogger sits outside the computer’s system, antivirus programs and security scans cannot detect it. The computer just sees a normal keyboard.
At home, this is rarely a concern because a stranger would need to walk into your house to plug the device in. The real risk is on computers in public or shared spaces where many people come and go. These include:
Library computers
Hotel business centers
Copy shops and internet cafes
Shared desks at a workplace, school, or community center
On a desktop computer, the USB ports are often on the back of the machine where no one looks before sitting down. If someone slips a keylogger onto a hotel or library computer, it can record everyone who uses that desk until someone notices the extra plug. This is different from software spyware on a phone or computer or a keylogger app on a phone, which are programs installed inside the device rather than physical plugs.
| Normal connection | With a keylogger |
|---|---|
| Where the cord meets the computer | |
| Normal connectionThe plastic plug at the end of the keyboard cord goes straight into the slot on the computer. | With a keyloggerThe keyboard cord plugs into an extra plastic tube or block, which then plugs into the computer. |
| Along the keyboard cord | |
| Normal connectionOne continuous wire runs from the keyboard to the computer with nothing in the middle. | With a keyloggerA small adapter or box sits in the middle of the cord, joining two ends together. |
| Other slots on the computer | |
| Normal connectionOnly the mouse, keyboard, and monitor cords are plugged in. | With a keyloggerAn unexplained thumb drive or tiny plastic cap sits in an extra slot. |
What to do
When you sit down at a public or shared computer, a quick look at the cables and a few careful habits will protect your accounts.
Avoid typing important passwords on public computers. If you only need to look up directions, read the news, or print a boarding pass that does not require a password, a keylogger cannot steal anything sensitive. Save banking, shopping, and personal email for your own phone or home computer.
Trace the keyboard cord before you type. Follow the wire from the back of the keyboard all the way to the computer. The cord should be one single piece that plugs straight into the slot. Look at the back of the computer to make sure there is no extra cylinder or block between the cord and the machine.
Do not use a computer with an extra plug. If you see an unfamiliar adapter on the keyboard cord on a library or hotel computer, leave it where it is and walk away. Just as you should never plug in an unknown USB drive, do not unplug an unfamiliar device and put it into your own computer to see what is on it. Tell the staff at the front desk what you found and ask to use a different machine.
Copy and paste passwords instead of typing them. A hardware keylogger only records keys you physically press on the keyboard. It cannot see what you click with the mouse or what you copy and paste.
Change your passwords if you think a computer was unsafe. If you already typed an email or bank password on a shared computer and noticed a strange plug afterward, go to a trusted device like your own phone and change that password right away. You can also check which devices are signed into your email and sign out any you do not recognize.
Common questions
Can antivirus software find a hardware keylogger?
No. Antivirus software scans the programs and files inside your computer. A hardware keylogger sits outside the computer on the keyboard wire, so security software cannot see it. Looking at the cable with your own eyes is the main way to spot one.
Do laptops and phones get hardware keyloggers?
Phones do not use wired keyboards, so they do not get hardware keyloggers. Laptops have built-in keyboards, so someone cannot easily plug a device onto a cord unless you use an external plug‑in keyboard. Putting a hardware keylogger inside a laptop requires taking the case apart with tools.
What if the shared computer has a wireless keyboard?
A wireless keyboard often uses a tiny plastic receiver plugged into a USB slot on the computer. That small receiver is normal and usually has the keyboard brand name printed on it, such as Logitech, Microsoft, or Dell. However, some wireless keyloggers can still sit in the slot or record older wireless signals nearby, so it is still best not to type private passwords on a shared computer.
You can read our guide on protecting your phone and computer for more ways to look after your devices.