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.
Table of Contents
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:
- Pop-up ads appear even when your browser is closed
- Your browser’s homepage or search engine changed on its own
- New toolbars, extensions or programs you don’t remember installing
- The fan runs loud and the PC is slow even when you’re doing nothing
- Your antivirus was turned off and won’t turn back on
- Friends get strange messages or emails “from you”
- Files are missing, renamed, or won’t open
- You see a scary message saying your PC is locked and you must call a number or pay
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.
- Open Settings > System > Recovery.
- Next to Advanced startup, click Restart now.
- Choose Troubleshoot > Advanced options > Startup Settings > Restart.
- 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.

Step 3: Delete temporary files
Malware often hides in temporary folders. Clearing them also makes your scans finish faster.
- Press the Windows key, type Disk Cleanup, and open it.
- Pick your C: drive.
- Tick Temporary files and Temporary Internet Files, then click OK.

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.
- Open Start, type Windows Security, and open it.
- Click Virus & threat protection > Scan options.
- 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.

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.)
- Go back to Virus & threat protection > Scan options.
- 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.

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.
- 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.
- Install it and click Scan.
- When the results appear, make sure everything is ticked, then click Quarantine.
- 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.

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:
- Type chrome://extensions in the address bar and remove anything you don’t recognise.
- 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.

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.
- Open Settings > System > Recovery.
- Click Reset PC and choose Keep my files.
- 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.
- 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.
- Turn on two-step verification for your email and bank. Even if someone has your password, they can’t get in without your phone.
- Update Windows and all your apps. Go to Settings > Windows Update and install everything. Many viruses get in through old, unpatched software.
- 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.
- Keep Windows Security turned on. For most home users, it’s enough. You don’t need to pay for antivirus unless you want extra features.
- Download software only from the official website or the Microsoft Store. Cracked games and “free” versions of paid software are the number one way people get malware.
- Think before you click. Be suspicious of email attachments and links you weren’t expecting, even from people you know.
- Ignore “your PC is infected” pop-ups on websites. Real antivirus warnings come from the program on your computer, not from a web page.
- Back up your files to an external drive or cloud storage every week. If the worst happens, you lose nothing.
- Don’t use an administrator account for daily work if you share the PC with kids or less careful users.
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.
Asalamulikum its lovely and informative