To get rid of a virus on your computer, disconnect from the internet, restart in Safe Mode, and run a full scan with reputable antivirus software, then quarantine or remove what it finds. After that, remove suspicious apps and browser extensions, reset your browser, update your software, and change your passwords from a clean device. If the scan keeps finding threats or the computer still misbehaves, back up your files and reinstall the operating system.
Key takeaways
- Disconnect from the internet first, then restart in Safe Mode before you scan — most malware cannot run there.
- A full antivirus scan is the safest removal method; manual deletion is a last resort for advanced users only.
- After cleanup, reset your browser, update everything, and change passwords from a clean device.
Your computer is slow, pop-ups appear out of nowhere, and your browser homepage changed itself. You probably have malware — and in most cases you can remove it yourself in under an hour. The trick is the order: isolate, scan, clean, then secure. Skip a step and the virus comes back.
How do you know your computer has a virus?
A virus rarely announces itself. Look for a pattern: sudden slowness, frequent crashes, pop-ups even when the browser is closed, a changed homepage or search engine, new toolbars or extensions you did not install, programs opening on their own, or friends receiving strange messages from your accounts.
Any one of these can have a harmless cause — a full hard drive also slows a computer down. Several together, especially after downloading a free program, opening an attachment or clicking a suspicious link, mean you should treat the computer as infected and start the cleanup below.
Before you start, do not log in to your bank or email on the infected computer, and do not enter passwords anywhere until the cleanup is done. If you need to change a password urgently, use your phone instead.
What are the steps to remove a virus from a computer?
Removal follows the same six steps on Windows and Mac. The details differ, but the order does not.
- Disconnect from the internet. Cut the virus off from its server and stop it spreading to other devices on your network.
- Restart in Safe Mode. Only essential programs run, so most malware cannot launch or interfere with the scan.
- Run a full antivirus scan. Use a reputable tool and choose a full system scan, not a quick scan.
- Quarantine or remove what it finds, then scan again to catch anything left behind.
- Reset your browser and remove suspicious apps and extensions.
- Update everything and change your passwords from a clean device.
How do you remove a virus from a Windows computer?
Windows has the tools built in, so you can do the whole cleanup without buying anything. Microsoft Defender is already installed and is a capable scanner when it is up to date.
1. Disconnect from the internet
Unplug the Ethernet cable, or click the Wi-Fi icon in the bottom right and disconnect. This stops the malware sending data out and stops it downloading more malware.
2. Restart in Safe Mode
Go to Start, then Power, hold the Shift key and click Restart. Choose Troubleshoot, then Advanced options, then Startup Settings, then Restart. After the computer restarts, press 4 or F4 for Safe Mode, or 5 or F5 for Safe Mode with Networking if you need to download a scanner.
3. Run a full scan and remove threats
Open Windows Security, go to Virus and threat protection, and run a full scan. When it finishes, quarantine or remove everything it finds, then run the scan a second time to catch remnants. If Defender finds nothing but the computer still misbehaves, run a second opinion scan with a free on-demand scanner from a reputable vendor. Norton’s malware removal guide and Malwarebytes’ virus removal guide both recommend the same approach.
4. Check Task Manager and installed apps
Press Ctrl, Shift and Esc to open Task Manager and look for unfamiliar processes using a lot of CPU or memory. Then open Settings, then Apps, sort by install date, and uninstall anything you do not recognize or did not install yourself. Be careful: if you are unsure about a program, search its name before removing it.
How do you remove a virus from a Mac?
Macs can get viruses too, and the cleanup follows the same logic with Mac tools. Do not assume a Mac is clean just because it is a Mac.
1. Disconnect from the internet
Click the Wi-Fi icon at the top of the screen and toggle Wi-Fi off, or unplug the Ethernet cable.
2. Enter Safe Mode
On Apple silicon Macs, shut the Mac down, then press and hold the power button until the startup options appear, select your disk, hold Shift and click Continue in Safe Mode. On Intel Macs, restart and immediately press and hold Shift until the login screen appears.
3. Check Activity Monitor and scan
Open Finder, then Applications, then Utilities, then Activity Monitor, and look for processes using heavy CPU that you do not recognize. Quit anything suspicious, then run a scan with a macOS-compatible anti-malware tool such as Malwarebytes for Mac and remove what it finds.
4. Remove suspicious apps and extensions
Delete any app in the Applications folder you do not recall installing. Then remove unknown extensions from Safari, Chrome and Firefox, and reset your browser homepage and search engine to your usual settings.
How do you remove a virus from your browser?
Many infections live only in the browser: a hijacked homepage, a malicious extension, or notification spam. These survive an antivirus scan if the extension itself is not flagged, so clean the browser separately.
- Remove unknown extensions. In Chrome, go to Settings, then Extensions. In Firefox, go to Add-ons. In Safari, go to Settings, then Extensions. Remove anything you did not install.
- Reset the homepage and search engine to the ones you normally use.
- Clear cache and cookies, and revoke notification permission for any site you do not recognize.
- Reset the browser settings if the problem persists — Chrome and Firefox both have a reset option that keeps your bookmarks.
Note that Google has retired the Chrome Cleanup Tool, so there is no built-in Chrome malware scanner any more. Your antivirus scan and the extension check above replace it.
What kind of virus do you have?
Knowing the type changes what you do next. These are the common ones, and how to recognize them.
| Type | Signs | What to do first |
|---|---|---|
| Adware | Pop-ups and ads everywhere, new toolbars | Remove extensions and suspicious apps |
| Browser hijacker | Homepage and search engine changed | Reset the browser, remove extensions |
| Trojan | Hidden in a fake installer or attachment | Full antivirus scan in Safe Mode |
| Spyware / keylogger | Accounts accessed, passwords changed | Scan, then change all passwords from a clean device |
| Ransomware | Files encrypted, ransom note on screen | Disconnect, do not pay, restore from backup |
| Rootkit | Scan finds nothing but problems persist | Reinstall the operating system |
Ransomware is the exception to the cleanup routine: do not try to clean it in place. Disconnect the computer, do not pay the ransom, and restore from a backup made before the infection. Our guide to how to know if your phone is hacked covers similar warning signs on mobile, where the same tricks are used.
What should you do after removing a virus?
Cleanup is only half the job. The other half is closing the hole the virus came through, so it does not happen again next week.
- Update the operating system and all software. Most viruses arrive through a known, patched vulnerability, so install every pending update.
- Change your passwords from a clean device, starting with email and banking. If the malware included a keylogger, any password typed on the infected computer may be stolen.
- Check for new mail-forwarding rules, unknown devices and changed recovery addresses on your email and important accounts.
- Turn on automatic backup and real-time antivirus protection so the next infection is a restore, not a crisis.
- Run one more full scan in normal mode a day later, to confirm nothing came back.
A password manager helps here: it generates a unique password per site, so one stolen password cannot open your other accounts. Test your new passwords with our free password strength checker.
When should you reinstall instead of cleaning?
Sometimes cleaning is not enough. Reinstall the operating system when scans keep finding threats, when the computer still misbehaves after a full cleanup, or when you suspect ransomware or a rootkit. A rootkit hides deep in the system and can survive ordinary removal, so a clean reinstall from known-good installation media is the only certain fix.
Before reinstalling, back up your personal files — documents, photos and anything you cannot replace — to an external drive, then scan that backup on a clean computer before restoring it. Do not back up programs or system files, since those can carry the infection with them. After the reinstall, restore only the files, update everything, and change your passwords.
How do you stop the next virus?
Prevention is cheaper than cleanup, and it is mostly habits rather than software.
- Keep automatic updates on for the operating system, browser and apps.
- Download software only from official sites and app stores. Free versions from forums and file-sharing sites are a classic malware source.
- Do not open unexpected attachments, even from people you know — their account may be compromised. Our phishing email examples show what these messages look like.
- Use an ad blocker and be skeptical of pop-ups claiming your computer is infected — those pop-ups are often the infection.
- Keep real-time antivirus running and back up automatically, so recovery is a restore rather than a rebuild.
The bottom line
Most computer viruses can be removed in six steps: disconnect, Safe Mode, full scan, remove, reset the browser, then update and change passwords. The order matters more than the tool, and a second scan catches what the first one missed.
If the infection keeps coming back or you suspect ransomware or a rootkit, stop cleaning and reinstall from scratch — it is faster and more certain than fighting the same malware twice. And once the computer is clean, turn on automatic updates and backups so the next one never gets in. Check your new passwords with the free password strength checker.
Frequently asked questions
How do I know if my computer has a virus?
Common signs are sudden slowness, frequent crashes or pop-ups, a changed browser homepage, new toolbars or extensions you did not install, programs opening on their own, and friends receiving strange messages from your accounts. Any one of these can have a harmless cause, but several together mean you should scan the computer.
Can I remove a virus without antivirus software?
Sometimes, if the malware is just a suspicious app or browser extension you can uninstall. But most modern malware hides in several places at once, so manual removal usually misses parts of it. A reputable antivirus scan is safer, and free on-demand scanners exist for a one-time cleanup.
What is Safe Mode and why does it help remove a virus?
Safe Mode starts Windows or macOS with only essential programs and drivers, so most malware does not launch. That stops the virus interfering with your scan and makes it easier for antivirus software to find and remove it.
Will resetting my browser remove a virus?
It removes browser-based malware such as malicious extensions, hijacked homepages and unwanted notifications, but it does not remove a virus installed on the computer itself. Reset the browser after the antivirus scan, not instead of it.
Should I pay for virus removal software?
Not necessarily. Windows includes Microsoft Defender, and reputable vendors offer free on-demand scanners for a one-time cleanup. Paid antivirus adds real-time protection, which is worth having after the cleanup to stop the next infection.
When should I reinstall Windows or macOS instead of cleaning it?
Reinstall when scans keep finding threats, the computer still misbehaves after a full cleanup, or you suspect ransomware or a rootkit. A clean reinstall from known-good installation media is the only way to be certain the malware is gone.
Can a Mac get a virus?
Yes. Macs get malware too, including adware, browser hijackers and trojans hidden in fake installers. The cleanup steps are the same: disconnect, boot into Safe Mode, scan with a Mac-compatible tool, and remove suspicious apps and extensions.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against removal guides from Norton, Malwarebytes and McAfee, and Comodo’s step-by-step removal guide.
How we write and fact-check →