How to Remove Viruses from Your Computer
In this article
This guide explains how to remove viruses and other malware from a Windows PC or Mac. You will learn the steps to identify and eliminate infections, what tools to use, and how to avoid common pitfalls. By the end, you should have a clean system and a better understanding of how to prevent future infections.
What You'll Need
- A computer with internet access (to download tools if needed).
- A second device (phone or another computer) to search for solutions if your main computer is severely infected.
- An external USB drive (optional) for backing up important files before starting.
- Patience – some scans can take over an hour.
Step-by-Step
- Disconnect from the internet. Unplug your Ethernet cable or turn off Wi-Fi. This prevents the virus from communicating with its command server or spreading to other devices on your network.
- Boot into Safe Mode. Safe Mode loads only the essential drivers and services, which often stops malware from running. On Windows 10/11: hold Shift while clicking Restart, then choose Troubleshoot > Advanced options > Startup Settings > Restart, then press 4 or F4. On Mac: restart and hold the Shift key until the login window appears.
- Open your built-in antivirus. Windows has Windows Security (or Defender), and macOS has XProtect built in. Run a full scan. This may take a while. If your built-in antivirus finds nothing, proceed to the next step.
- Install a reputable on-demand scanner. While still in Safe Mode, download and run a second-opinion scanner like Malwarebytes (free version) or HitmanPro. These tools are designed to catch what your main antivirus might miss. Run a full scan and quarantine anything found.
- Remove browser extensions and reset browser settings. Many viruses hide as browser extensions. In Chrome: go to the three-dot menu > More tools > Extensions, and remove anything you don't recognize. In Firefox: Menu > Add-ons and themes > Extensions. In Safari: Safari menu > Settings > Extensions. Also reset your homepage and search engine to default.
- Check startup programs. On Windows: open Task Manager (Ctrl+Shift+Esc) and go to the Startup tab. Disable anything suspicious. On Mac: go to System Settings > General > Login Items and remove unknown items.
- Delete temporary files. Viruses often hide in temp folders. On Windows: search for "Disk Cleanup" or "Storage Sense" and run it. On Mac: use Finder > Go > Go to Folder and type ~/Library/Caches, then delete contents of suspicious folders (be careful not to delete system caches).
- Run a full scan again. After removing threats, restart your computer normally and run another full scan with your main antivirus to ensure nothing remains.
- Update everything. Install all pending Windows or macOS updates, and update your browser and plugins. This patches vulnerabilities that the virus exploited.
- Change your passwords. If you suspect keylogging or data theft, change passwords for critical accounts (email, banking, social media) on a clean device after the system is clean.
Common Mistakes
- Not disconnecting from the internet. Some malware re-downloads itself if you stay online.
- Skipping Safe Mode. Many viruses resist removal while Windows is running normally.
- Paying for fake "removal" tools. Scammers often show fake alerts and ask for payment. Only use well-known, legitimate software.
- Deleting system files by accident. Don't delete files you're unsure about; you could break your operating system.
- Not backing up important files. If the infection is severe, you might need to reset your PC, and you could lose data.
Tips
- Keep your antivirus definitions up to date. Most antivirus software updates automatically, but check occasionally.
- Use a standard (non-admin) user account for daily tasks. This limits what malware can do.
- Enable "Cloud-delivered protection" in Windows Security or similar features in third-party antivirus for real-time threat intelligence.
- Be cautious about email attachments and links, even from known senders if the message seems odd.
- If you must download software, use official sources only. Freeware sites often bundle adware.
Troubleshooting
If the virus won't go away: Try a rescue disk. Create a bootable USB with a tool like Microsoft Defender Offline (for Windows) or a Linux live USB. Boot from the USB and scan your hard drive from outside the operating system. This can remove rootkits and persistent malware.
If your computer is completely locked or won't boot: Use another device to search for the specific error message. You may need to use Windows Recovery Environment (WinRE) to perform a system restore or startup repair. On Mac, use macOS Recovery (Cmd+R at startup) to reinstall the OS.
If you suspect a rootkit: Rootkits hide deep in the system. Run a rootkit-specific scanner like Malwarebytes Anti-Rootkit (now part of Malwarebytes) or use the Windows Defender Offline scan. If that fails, a clean reinstall of the OS is the safest option.
If your antivirus is disabled and you can't re-enable it: This is a common malware tactic. Boot into Safe Mode and try to enable it. If it still won't start, download a portable scanner on another device and transfer it via USB.
If you see fake antivirus pop-ups: Do not click on them. Close your browser, disconnect from the internet, and run a scan in Safe Mode. These pop-ups are often the virus itself.
Frequently Asked Questions
Can I remove a virus for free?
Yes. Windows Security is free and built-in, and Malwarebytes has a free version that works well for on-demand scans. You don't need to pay for removal.
How long does virus removal take?
It depends on the severity. A full scan can take 30 minutes to a few hours. If you need to reset your OS, it can take a full day.
Will I lose my files?
Usually not, but it's possible if the virus corrupts them or if you need to do a full reset. Always back up important files to an external drive or cloud before starting.
How do I know if my computer has a virus?
Common signs: slow performance, frequent crashes, unexpected pop-ups, new toolbars, changed homepage, or unknown processes in Task Manager. But some viruses are silent.
What's the difference between a virus and malware?
A virus is a type of malware that replicates itself. Malware is a broader term for any malicious software, including spyware, ransomware, and worms. Removal steps are similar.
Should I use multiple antivirus programs?
No. Running two real-time antivirus programs can cause conflicts and slow your system. Use one main antivirus and a second on-demand scanner for occasional checks.