Your computer suddenly feels slow. Strange pop-ups keep showing up. Your browser opens a search page you never chose. Something is wrong, and you’re pretty sure it’s a virus.

Good news first: in most cases, you can clean it yourself, for free, in about an hour. You don’t need to buy an expensive antivirus or hand your laptop to a repair shop.

This guide shows you how to remove virus from computer files and settings step by step, in the right order. It works on Windows 11 and Windows 10. If you follow it from top to bottom, you’ll remove most viruses, adware and malware, and you’ll know what to do if something stubborn refuses to leave.

Signs your computer has a virus

Not every slow PC is infected. But if you notice two or more of these, it’s worth running the steps below:

That last one is important. If a pop-up tells you to call “Microsoft Support” or pay to unlock your PC, do not call and do not pay. Microsoft never shows phone numbers in pop-ups (see our guide to fake “Windows Defender” pop-ups). Close the browser (press Ctrl + Shift + Esc, select the browser, click End task) and continue with this guide.

How to remove virus from computer: 7 free steps

Do these in order. Each step catches things the one before it may miss.

Step 1: Disconnect from the internet

Unplug the network cable or turn off Wi-Fi. This stops the virus from sending your data out or downloading more junk. You’ll reconnect for a few minutes later, when you need to download a scanner.

Also, don’t type any passwords on this PC until it’s clean. If the malware logs keystrokes, it would capture them.

Step 2: Restart in Safe Mode with Networking

Safe Mode starts Windows with only the basic drivers. Most malware can’t run there, which makes it much easier to remove. Microsoft explains all the startup options on its Safe Mode support page.

  1. Open Settings > System > Recovery.
  2. Next to Advanced startup, click Restart now.
  3. Choose Troubleshoot > Advanced options > Startup Settings > Restart.
  4. When the list appears, press 5 (or F5) for Safe Mode with Networking.

Shortcut: hold Shift while you click Restart from the Start menu. It takes you to the same blue screen.

Windows Startup Settings screen with option 5, Enable Safe Mode with Networking, highlighted

Step 3: Delete temporary files

Malware often hides in temporary folders. Clearing them also makes your scans finish faster.

  1. Press the Windows key, type Disk Cleanup, and open it.
  2. Pick your C: drive.
  3. Tick Temporary files and Temporary Internet Files, then click OK.
Windows Disk Cleanup with Temporary files selected

Step 4: Run a full scan with Windows Security

Windows already comes with a solid free antivirus, Microsoft Defender. Most people never run its full scan.

  1. Open Start, type Windows Security, and open it.
  2. Click Virus & threat protection > Scan options.
  3. Select Full scan, then Scan now.

A full scan can take 30 minutes to a couple of hours. Let it finish. If it finds threats, click Start actions and let it remove or quarantine them.

Windows Security scan options with Full scan selected

Step 5: Run a Microsoft Defender Offline scan

Some malware (called rootkits) hides while Windows is running. The offline scan restarts your PC and checks it before Windows loads, so there’s nowhere to hide. (Microsoft’s own guide to removing malware from your Windows PC recommends the same scan.)

  1. Go back to Virus & threat protection > Scan options.
  2. Select Microsoft Defender Offline scan and click Scan now.

Your PC will restart, and the scan takes about 15 minutes. Save any open work first.

Microsoft Defender Antivirus (offline scan) option selected in Windows Security

Step 6: Get a second opinion with Malwarebytes (free)

No single scanner catches everything. A second one is cheap insurance. Download the free version only from the official Malwarebytes website, never from a pop-up or a third-party download site.

  1. Reconnect to the internet for a moment and download Malwarebytes from malwarebytes.com only. Never from a pop-up or a third-party download site.
  2. Install it and click Scan.
  3. When the results appear, make sure everything is ticked, then click Quarantine.
  4. Restart if it asks you to.

The free version scans and cleans on demand, which is all you need here. You don’t have to buy the premium trial.

Malwarebytes scan summary showing 0 threats detected

Step 7: Clean up your web browser

Many “viruses” people complain about are really browser hijackers: bad extensions that change your homepage and push ads.

In Chrome:

  1. Type chrome://extensions in the address bar and remove anything you don’t recognise.
  2. Go to Settings > Reset settings > Restore settings to their original defaults.

In Microsoft Edge: go to edge://extensions to remove extensions, then Settings > Reset settings.

Chrome extensions page with the Remove buttons highlighted

Now restart your PC normally (out of Safe Mode). For most people, the problem is gone at this point.

What if the virus won’t go away?

If pop-ups or strange behaviour come back after all seven steps, the infection is deeper than usual. You have two good options.

Option 1: Reset Windows and keep your files. This reinstalls Windows but keeps your personal files. You will lose installed programs, so note down what you use first.

  1. Open Settings > System > Recovery.
  2. Click Reset PC and choose Keep my files.
  3. Pick Cloud download if your internet is decent. It gives you a fresh copy of Windows instead of reusing files that might be infected.

Option 2: Wipe everything. Choose Remove everything in the same menu. Only do this after you’ve backed up your important files to an external drive or cloud storage. Scan that backup on another computer before you copy it back.

If your files were encrypted and you see a ransom note, stop here and read our guide on ransomware first. Don’t reset yet, because some ransomware can be decrypted with free tools, and a reset could make that harder.

When to get professional help: if this is a work computer, if it holds business or customer data, or if money has gone missing from your bank account. In those cases, a professional (or your company’s IT team) should handle it, and you should contact your bank right away.

After the virus is gone: 4 things to do right away

Removing the virus is only half the job. If it stole anything while it was there, you want to shut that door now.

  1. Change your passwords from a different, clean device. Start with email, then banking, then social media. Your email comes first because it can reset every other account.
  2. Turn on two-step verification for your email and bank. Even if someone has your password, they can’t get in without your phone.
  3. Update Windows and all your apps. Go to Settings > Windows Update and install everything. Many viruses get in through old, unpatched software.
  4. Check your bank and card statements for the next few weeks. Report anything you don’t recognise.

How to avoid getting infected again

Most infections come from a handful of habits. Fix these and you’ll rarely need this guide again.

Frequently asked questions

Can I remove a virus from my computer for free?

Yes. Windows Security (built into Windows 10 and 11) and the free version of Malwarebytes remove the vast majority of common viruses and adware. Paid antivirus adds extras like a VPN or password manager, but it isn’t required for cleaning.

Does Windows Defender remove viruses?

Yes. Microsoft Defender, part of Windows Security, detects and removes viruses, spyware and many other threats. Run a full scan and an offline scan for the best results, as shown in Steps 4 and 5.

How long does it take to remove a virus?

Usually one to three hours, mostly waiting for scans to finish. A Windows reset, if needed, can take another hour or two.

Will resetting my PC remove viruses?

In almost every case, yes, especially if you choose Remove everything and Cloud download. Very rare malware can survive in the firmware, but that’s extremely uncommon for home users.

Can a virus damage my hardware?

It’s very rare. Most malware wants your data, your money or your computer’s power, not to break it. If your PC gets very hot while idle, malware may be using it to mine cryptocurrency. Cleaning it fixes that.

Is it safe to use my computer while it has a virus?

Avoid it. Don’t log in to bank accounts, shop online or type passwords until you’ve finished the steps above.

Final thoughts

A virus feels scary, but it’s almost always fixable. Disconnect, boot into Safe Mode, run Windows Security’s full and offline scans, get a second opinion from Malwarebytes, and clean up your browser. That routine handles the vast majority of infections without spending a cent.

Then do the follow-up: new passwords, two-step verification, and updates. That’s what keeps it from happening again.

Still stuck? Tell us what you’re seeing in the comments, like the exact pop-up text or error message, and we’ll help you figure out the next step.