What a virus actually does and how you catch one
A virus is a program that copies itself and spreads from one file to another on your computer, usually without your knowledge. It is different from other malware because it needs a host file to survive — it attaches itself to something you already have, like a document or an executable program, and runs when you open that file.
You catch a virus most often by downloading an infected file from the internet, opening an email attachment that contains one, or visiting a website that exploits a security hole in your browser. Once it is on your machine, it can slow your computer down, delete files, steal passwords, or use your computer to send itself to other people.
The first sign is usually performance — your computer becomes noticeably slower, programs crash, or you see pop-ups you did not click on. Some viruses hide better and you may not notice anything until your antivirus software detects them or your computer stops working altogether.
Key Takeaways
- Run a full scan with your antivirus software first, because most viruses are caught and removed by the tools already on your computer.
- If your antivirus does not find anything but your computer still behaves strangely, restart in Safe Mode and scan again, because some viruses hide from normal scans.
- Malwarebytes is a second-opinion tool that catches viruses your main antivirus missed, and you can run it for free in limited mode.
- If nothing works, back up your important files and reinstall Windows or macOS, which removes everything including any virus hiding deep in your system.
- After removal, change your passwords from a different device, because viruses often steal login credentials before they are detected.
Run a full antivirus scan on your computer
Your computer almost certainly has antivirus software already installed. On Windows, this is Windows Defender (built into Windows 10 and later). On Mac, it is Xprotect (built in). Both run in the background and catch most viruses automatically, but you can force a full scan to check for anything that slipped through.
On Windows: Open the Start menu, type "Windows Security" and press Enter. Click "Virus & threat protection" on the left. Under "Current threats," click "Scan options." Select "Full scan" and click "Scan now." This will take 30 minutes to several hours depending on how much is on your drive. Let it finish completely — do not turn off your computer or close the window.
On Mac: Open System Preferences (or System Settings on newer versions), click "Security & Privacy," then the "Privacy" tab. You cannot manually run Xprotect, but you can check the scan log. If you want a more thorough scan, skip to the Malwarebytes section below.
If Windows Defender or Xprotect finds a virus, it will quarantine it (move it to a safe place where it cannot run) and ask what you want to do. Choose "Remove" to delete it. Restart your computer when the scan finishes.
Restart in Safe Mode and scan again
Some viruses are sophisticated enough to hide from a normal antivirus scan by loading themselves into memory before the scan starts. Safe Mode is a stripped-down version of Windows or macOS that loads only the bare minimum — no third-party programs, no startup items, and no virus code. Running a scan in Safe Mode catches viruses that hide in normal mode.
On Windows 10 or 11: Hold down the Shift key and click the power button in the Start menu, then click "Restart." Your computer will restart into a menu. Click "Troubleshoot," then "Advanced options," then "Startup Settings," then "Restart." When your computer restarts, press 4 or F4 to enter Safe Mode. Once you are in Safe Mode, open Windows Security again and run another full scan as described above.
On Mac: Shut down your computer completely. Turn it back on and immediately hold down the Shift key until you see the login screen. Log in — you are now in Safe Mode. Open System Preferences and check the Security & Privacy log again, or move on to Malwarebytes below.
After the Safe Mode scan finishes and removes any viruses it finds, restart your computer normally by clicking the power button and selecting "Restart" or "Shut Down."
Use Malwarebytes as a second opinion
Malwarebytes is a separate antivirus tool that catches viruses your main antivirus missed. It is especially good at finding newer viruses that Windows Defender or Xprotect do not recognize yet. The free version scans and removes viruses but does not run in the background — you have to start each scan manually.
Go to malwarebytes.com on another device (a phone, tablet, or different computer) and download Malwarebytes. If your infected computer is too slow to download safely, use another device and transfer the installer on a USB drive. Install Malwarebytes on your infected computer, open it, and click "Scan." Choose "Threat Scan" (faster) or "Full Scan" (more thorough). Let it finish completely.
If Malwarebytes finds viruses, click "Quarantine" to remove them. Restart your computer when it finishes. If Malwarebytes finds nothing and your computer still runs slowly or behaves strangely, the problem may not be a virus — it could be a hardware issue, a failing hard drive, or too many programs running at startup. Move on to the next section.
Reinstall Windows or macOS if nothing else works
If you have run full scans in both normal mode and Safe Mode, used Malwarebytes, and your computer still has problems, a virus may be hiding so deep in your system that normal tools cannot reach it. The only way to be completely certain it is gone is to wipe your hard drive and reinstall your operating system from scratch.
Before you start: Back up all your important files to an external hard drive or cloud storage (Google Drive, OneDrive, iCloud). A virus may have corrupted some files, so check what you are backing up — do not back up executable files (.exe, .app, .bat) unless you are certain they are safe.
On Windows: Go to microsoft.com/software-download/windows11 (or windows10 if you use Windows 10) on another computer. Download the Windows installation tool, follow the steps to create a bootable USB drive, then plug that USB drive into your infected computer. Restart your computer and boot from the USB drive (usually by pressing F12, Del, or Esc during startup — the key varies by manufacturer). Follow the Windows installer to erase your drive and reinstall Windows. This takes 30 to 60 minutes.
On Mac: Restart your computer and hold Command + R until you see the Apple logo. This boots into Recovery Mode. Click "Reinstall macOS" and follow the steps. Your Mac will erase itself and reinstall the operating system. This takes 45 minutes to 2 hours.
Change your passwords after removal
Most viruses steal passwords and login credentials before they are detected. Even if you have removed the virus, anyone who had access to your computer may have copied your passwords for email, banking, social media, or work accounts.
Change your passwords from a different device — a phone, tablet, or different computer — not from the computer you just cleaned. This way, if the virus is still hiding somewhere, it cannot intercept your new password as you type it. Start with your email password, because email is the master key to resetting everything else. Then change passwords for your bank, credit card, PayPal, and any other financial accounts. After that, change social media and work passwords.
If you use the same password for multiple accounts, change all of them. If you cannot remember all your passwords, use a password manager like Bitwarden, 1Password, or LastPass to generate and store strong, unique passwords for each account.
Prevent viruses in the future
After you have removed a virus, take steps to avoid catching another one. Keep Windows or macOS updated by turning on automatic updates — viruses often exploit security holes that updates patch. Do not download files from untrusted websites, and be suspicious of email attachments from people you do not know. Use a password manager so you do not reuse passwords across sites. Enable two-factor authentication on important accounts like email and banking.
Your built-in antivirus (Windows Defender or Xprotect) is sufficient for most people if you follow these habits. You do not need to buy expensive antivirus software — the free tools that come with your operating system are as good as or better than paid alternatives.
Frequently Asked Questions
How long does it take to remove a virus?
A full antivirus scan takes 30 minutes to several hours depending on how much data is on your computer. If you run Safe Mode scans and use Malwarebytes, add another 2 to 4 hours total. If you have to reinstall your operating system, expect 1 to 2 hours for the installation plus time to restore your files and reinstall programs.
Will removing a virus delete my files?
Antivirus scans remove the virus but leave your other files alone. However, some viruses delete files as part of what they do, so files may already be gone before you run the scan. Reinstalling Windows or macOS will erase everything on your drive, which is why you must back up first.
Can I catch a virus from visiting a website?
Yes, if the website exploits a security hole in your browser. This is less common than it used to be because browsers are updated frequently, but it still happens. Keep your browser updated and avoid clicking suspicious links or downloading files from sites you do not trust.
What if my computer will not start after I remove the virus?
If your computer will not boot into Windows or macOS, the virus may have damaged critical system files. Your best option is to reinstall your operating system using a bootable USB drive, which will restore those files. You will lose any files on your drive unless you can recover them afterward.
Should I pay for antivirus software?
No. Windows Defender and Xprotect are free, built into your operating system, and perform as well as or better than paid antivirus software in independent tests. Paid software often slows your computer down and nags you to renew your subscription. Stick with what came with your computer.