How To Get Rid of Viruses: 3 Steps to Find and Remove Viruses From Your Computer

An infected computer is stressful, but here's a step-by-step guide to get rid of viruses.
We receive compensation from the products and services mentioned in this story, but the opinions are the author's own. Compensation may impact where offers appear. We have not included all available products or offers. Learn more about how we make money and our editorial policies.

Using an antivirus program is the best way to get rid of and prevent viruses on your computer. Every day there are over 450,000 new malicious programs registered by the AV-TEST Institute.[1] Attackers want you to install viruses so they can collect personal data (like discovering your password), push more ads, trick you into buying fake software, or merely disrupt a computer system.

Despite our best attempts to keep our devices safe from hackers and scams, sometimes we unintentionally download viruses. While this is a stressful situation, read on to learn how to know if you have a computer virus, how to fix it, and how using a good antivirus can prevent it from happening in the future.

In this article
How to get rid of viruses on your computer
Do I have viruses on my computer?
How to avoid computer viruses
FAQs
Bottom line

How to get rid of viruses on your computer

The first step for getting rid of viruses on any device is to download a good antivirus and security suite.

Without an antivirus software program, viruses can go virtually undetected. It may take some time for you to notice the signs of a computer virus, and by then it may be too late. The attacker could already have stolen valuable and sensitive information from your computer.

These three antivirus programs topped our list after testing as having some of the best protection available:

3 best antivirus programs

  • TotalAV: Consistently earning top marks in AV-TEST's protection tests, TotalAV comes with a host of security features to keep your computer safe and help you remove malware. These include scans for zero-day attacks plus phishing and ransomware protection. TotalAV also offers a password manager and ad blocker to further secure your private data.

    Get TotalAV | Read Our TotalAV Review
  • Bitdefender: Anti-malware protection, identity monitoring, parental controls — Bitdefender does it all. You'll be hard-pressed to find an antivirus that offers as many features as it does, and with top-notch protection scores to boot.

    Get Bitdefender | Read Our Bitdefender Review
  • AVG: Cyber threats are everywhere online, but AVG works hard to make sure you don't have to worry about them. It protects against malicious Wi-Fi networks, phishing sites, and ad trackers. We really like that AVG prioritizes both security and privacy with its security suite.

    Get AVG | Read Our AVG Review

After you install antivirus software, the process to remove viruses is slightly different for PCs and Macs. Keep reading to discover what you need to do to restore security to your computer.

No Fuss, Real-Time Online and Mobile Protection
4.7
Editorial Rating
Learn More
On TotalAV's website
Antivirus Software
TotalAV
First year discount on paid plans
  • Real-time protection from viruses, malware, and online threats
  • Blocks tracking cookies and ads, proactively monitors for data breaches, and option to schedule smart scans
  • 100% compatible with Windows, Mac, Android, and iOS operating systems on up to 3 devices
  • Lacks firewall protection

How to clear viruses from a Windows PC

If you think your Microsoft Windows PC has a computer virus, follow this step-by-step guide to remove it.

Step 1: Install antivirus software

Windows 10 and 11 computers often include Windows Security (also commonly called Windows Defender, Windows Defender Security Center, or Microsoft Defender), which can detect and remove malware files.

However, the built-in Windows Defender software may not be good enough. This is because it doesn’t protect non-Microsoft programs by default. For example, if your primary browser is Google Chrome, Windows Defender can't help you unless you download the Microsoft Defender Browser Protection extension.

Windows Defender is now called Microsoft Defender. Get the full scoop on what this security program does (and doesn't do) in our Microsoft Defender review.

By downloading additional antivirus software, you give yourself the best possible tools to detect and remove viruses. If our recommendations for TotalAV, Bitdefender, and AVG above don't meet your needs, check out our guide to the best antivirus for Windows as well as our best Mac antivirus guide for more suggestions. 

If you want to be extra cautious, you could run multiple virus scans from different security software providers to ensure they catch all viruses, especially newly developed malware.

Step 2: Reboot in safe mode

Safe mode is when the Windows PC starts with only the essential files and drivers. By using safe mode, it prevents the virus from blocking antivirus scans. Here is how to reboot in safe mode on a Windows 11 computer:

  1. Turn your computer on or restart it.
  2. On the Windows sign-in screen, press and hold the Shift key, then click Power > Restart. This will restart your computer.
  3. A "Choose an option" menu will appear. Select Troubleshoot, Advanced options, then choose Startup settings, and finally hit Restart.
  4. The restart will give you another list of options. You'll want to select 4 or press F4 to start your PC in safe mode without networking. This enables you to be in safe mode and stay offline. If you need internet access during safe mode, then select 5 or press F5.

Step 3: Run a full virus scan and uninstall infected files

Once you've installed antivirus software and rebooted your computer into safe mode, you're ready to run a virus scan. You'll want to follow the instructions from your chosen antivirus provider on how to do a virus scan.

The virus scan should detect any files with a virus and list them at the end of the scan. Then you can safely delete the infected files from your computer. You may want to run a second scan to ensure all viruses are removed.

Once you've completed a virus scan and removed all malicious files, you can exit safe mode. All you need to do is turn your computer off and start it back up as you would normally.

How to remove a virus from a Mac

Many people think Macs are safe from viruses, but it's not a 100% guarantee. Mac malware increased by more than 60% in 2020.[2] If you’re a Mac owner, you should take precautions to make sure your computer is safely guarded against threats like viruses.

A Mac computer has a slightly different process for detecting and removing viruses. Follow along with our step-by-step guide on how to remove viruses from a Mac.

Step 1: Install antivirus software

MacOS operating systems come with XProtect antivirus software already installed. It automatically scans for viruses without any extra work from you.

But XProtect does have some drawbacks. It's not great at blocking potentially unwanted programs (PUPs) or adware. This means your Mac could get infected even with XProtect.

To truly catch all possible viruses, you should install antivirus software compatible with your Mac. Some possible options include:

  • CleanMyMac X: Along with a friendly interface, CleanMyMac X sports a full suite of security tools, including real-time protection. CleanMyMac X also helps you uninstall pesky apps that want to stick around as well as update apps for better security. It also comes with a disk space visualizer and cleanup tools to help you regain that precious RAM and have your MacBook running like new again.

    Get CleanMyMac X | Read Our CleanMyMac X Review
  • MacKeeper: Developed just for macOS, MacKeeper keeps tabs on your Mac and lets you know if it spots any security risks like suspicious emails and potentially unwanted programs (PUPs). It also comes with optimization tools that help you keep your Mac clean and running smoothly.

    Get MacKeeper | Read Our MacKeeper Review
  • AVG: We were pleasantly surprised to see AVG worked well with our MacBook during testing. This well-known antivirus offers plenty of scanning options as well as anti-phishing and real-time protection tools that include webcam and ransomware protection.

    Get AVG | Read Our AVG Review

You could run virus scans from different providers to ensure they catch all viruses, especially newly developed malware.

Learn More
On CleanMyMac X's website
Antivirus Software
CleanMyMac X
  • Cleanup tools optimize space
  • Easy-to-use interface
  • No verified third-party malware tests

Step 2: Quit malicious applications

If you’re already suspicious about a specific program, simply uninstalling it may be enough to remove the virus. This could also be a good strategy if you recently downloaded files or apps and suddenly experienced crashing.

Here are the steps to take to quit malicious applications:

  1. Search for and open Activity Monitor.
  2. Search for known viruses like MacDefender, MacProtector, or MacSecurity. You could also view recent downloads.
  3. Double-click on the suspicious file and click Quit.
  4. Go to the Applications folder, find the suspicious file, and move it to Trash.
  5. Right-click your Trash and choose Empty Trash to permanently remove the file.

Restart your computer to see if this fixes the problem or if the malicious app reinstalls itself. Either way, you may want to install an antivirus software program to confirm the virus is completely removed from your Mac.

Step 3: Reboot in safe mode

Like a Windows PC, entering safe mode on a Mac computer ensures a virus can't block antivirus software from properly running. Safe mode only runs the essential files and drivers, which makes it easier to detect the virus. Here’s the process to reboot in safe mode on a Mac:

  1. Restart your Mac computer.
  2. While it's booting, hold down the Shift button.
  3. Depending on what type of Mac you have, you may need to click Continue in Safe Mode or log in and choose Safe Boot.
  4. The Mac will open in safe mode.

Once rebooted into safe mode, run a virus scan to determine if you have any infected files. Then delete or quarantine the files. To exit safe mode, simply restart your computer and let it run normally.

Do I have viruses on my computer?

Knowing when you have a virus or malicious software (malware) is complicated since a virus is usually designed so you won't notice it's there. But there are a few signs which may indicate you have a virus on your computer:

  • Slow computer performance
  • Persistent pop-up windows
  • Apps and programs you don't recognize
  • Frequent crashes
  • Unauthorized and unusual activities like password changes
  • Contacts receiving emails from you that you didn't send

How to avoid computer viruses

Having an awareness of best cybersecurity practices can minimize the risk of inadvertently downloading a virus. Here are some more tips to avoid computer viruses:

  • Use an antivirus software program with automatic scans for infections.
  • Don't click on pop-ups, especially if they appear even without the web browser open.
  • Don't open links or attachments in emails or social media messages where you don't know the sender.
  • Know how to download files safely.
  • Read user reviews of apps and programs before downloading them.
  • Keep systems and software updated to patch vulnerabilities.
  • Use a secure VPN, especially if you're using public Wi-Fi. We recommend NordVPN, ExpressVPN, or Surfshark.
  • Occasionally delete temporary files and cached content.
  • Remove apps or browser extensions you no longer use.

FAQs


+

Can you get a virus from visiting a website?

Yes, you can get a virus from visiting a website — even if you don't click on any links. Attackers are more sophisticated these days, and you only need to visit a fake or hacked website to have malicious code downloaded onto your computer.


+

Can iPhones get viruses?

iPhones are still capable of downloading viruses if you interact with a malicious email or website. As for malicious apps, iOS apps have to go through a rigorous security process before Apple will let them go live in the App Store. But don't worry too much because it's possible to remove malware from your iPhone.


+

Can resetting my PC remove a virus?

Resetting your PC by initiating a factory reset can remove most viruses.

A factory reset deletes all files from your computer — including everything stored on your hard drive and most viruses. This isn't always ideal because if you don't have any data backup, you will lose valuable documents and photos in a factory reset. It may also not remove complex viruses. 

A better alternative would be to reboot into a safe mode and run a virus scan to pinpoint the exact files with a virus.

Bottom line

When you suspect your PC or Mac computer has a virus, the first step is to confirm it with a virus scan. Antivirus software is important to download in order to find viruses. Next, you'll want to reboot your computer into safe mode without networking. No internet connection and the lack of unnecessary files make it easier for a virus scan to run without malware stopping it.

Once you run the scan, you can delete or quarantine the affected files. Then you can start your computer normally and hopefully have a virus-free computer.

While built-in antivirus apps like Windows Defender and XProtect are better than nothing, you'll want to optimize your computer's protection by getting a fully developed antivirus program. It can go a long way in detecting viruses early before they wreak havoc on your computer and data. To look at more options, take a look at our best antivirus programs guide.

Comprehensive Protection With Database Updates Every 3 Hours
4.7
Editorial Rating
Learn More
On Surfshark Antivirus's website
Antivirus Software
Surfshark Antivirus
WINTER DEAL: Up to 86% off + 4 months extra
  • Powerful app that offers 24/7 virus and malware protection that won’t hog your CPU or RAM
  • Includes webcam protection, fully customizable security, full or quick scans, and more
  • Compatible with Windows, Mac, and Android on unlimited devices

Author Details
Sara J. Nguyen is a freelance writer specializing in cybersecurity. She aims to help people protect their data while enjoying technology. She has written about online privacy and tech for over 5 years for several organizations. When she's not writing about the latest cybersecurity trends, you can find her on LinkedIn.

Citations

[1] Malware Statistics & Trends Report

[2] 2021 State of Malware Report