Does a Factory Reset Remove Viruses and Spyware? What Survives and What Doesn't

Key Takeaways
A factory reset feels like the nuclear option. You wipe everything, start fresh, and the problem goes away. For most people, that's the mental model, and it's mostly right. But 'mostly' is doing a lot of work in that sentence.
The short answer is: a factory reset removes the majority of viruses and spyware. It clears your files, apps, and settings, and for everyday malware, that's enough. The longer answer is that certain threats are built specifically to survive a reset, and knowing which ones matters when you're trying to figure out if your device is actually clean.
Understanding what a reset actually touches, and what it deliberately leaves alone, is the difference between feeling safe and being safe. This guide walks through both sides of that equation, so you can make an informed decision about whether a reset is sufficient for your situation or whether you need to go further.
What a factory reset actually does
When you perform a factory reset, your device erases your user data. That means your personal files, downloaded apps, login credentials, photos, and browser history are removed, and the device goes back to a fresh, set-up-from-scratch state.
What it generally doesn't touch is the operating system's own files and the firmware, the low-level code that runs before the operating system loads. The operating system itself stays, and so does the manufacturer's pre-installed software. And crucially, anything embedded at the firmware level stays.
Think of it like clearing out everything you moved into an apartment, but leaving the building itself intact. If the problem is in the walls, you haven't fixed anything.
On Android, the operating system image lives in the system partition, while apps and user data live in a separate userdata partition, as Android's documentation describes. A factory reset erases your data, according to Google, but reflashing the operating system is a different process. On Windows PCs, Microsoft's Reset this PC reinstalls Windows either from a cloud download or from files already on the PC, which means it reinstalls Windows and not the firmware that runs before Windows starts. On iPhones, Apple's tight control over the software stack makes firmware-level compromise harder, though not theoretically impossible. The architecture of the reset matters as much as the act of performing one.
What gets removed: the good news
For most infections, a factory reset works. Most malware, including adware, browser hijackers, trojans, and common spyware, lives in the user space. It's installed in apps, embedded in files you downloaded, or hiding in app data. A reset clears all of that.
Common threats a reset will remove include:
- Stalkerware installed by someone with physical access to your phone, along with other spyware running as apps (see the safety note below)
- Adware and browser hijackers that redirect your searches or flood your screen with pop-ups
- Trojans downloaded through fake apps or malicious links
- Ransomware that hasn't touched your device's firmware
- Keyloggers and credential stealers running as installed apps
If your phone started acting strange after visiting a sketchy website or downloading something off-brand, a factory reset is likely to solve it. Same goes for a laptop that picked up adware or a browser extension that won't die.
Adware bundled with free software downloads, stalkerware installed by an abusive partner, and trojans disguised as cracked games or productivity apps all live in user space, so a reset generally removes them. For most people dealing with a sluggish, misbehaving, or clearly compromised device, a factory reset followed by careful reinstallation of apps is an effective remedy.
A safety note on stalkerware. If you think someone is monitoring your phone, removing the software can alert them, and it deletes evidence. If you may be in danger, the FTC, the Coalition Against Stalkerware, and NNEDV Safety Net advise talking to a domestic violence advocate first, from a device the other person can't see. A reset also won't help if that person has your iCloud or Google login, because they may not need stalkerware at all. Change your account passwords and check which devices are signed in from a safe device.
What survives: the harder news
Some malware is built to outlast a reset. These aren't common threats targeting everyday users, but they exist, they've been documented, and they're worth understanding.
Firmware and UEFI threats
The most resilient malware operates below the operating system. Firmware implants embed themselves in the code that runs before your OS even loads. On PCs, this means the UEFI or BIOS layer.
These threats are well documented. ESET researchers identified LoJax in 2018, the first UEFI rootkit found in the wild. It wrote a malicious module into the motherboard's flash memory, and ESET attributed it with high confidence to the Sednit group, which is linked to Russian state hackers. ESET says LoJax survives an operating system reinstall and even a hard drive replacement. The fix is reflashing the firmware with a clean image, a delicate process, or replacing the motherboard.
Not every UEFI threat lives in the chip. In 2023, ESET reported BlackLotus, the first publicly known UEFI bootkit able to bypass Secure Boot on fully updated Windows 11 systems. BlackLotus lives on the disk's EFI System Partition rather than in the flash chip. Microsoft's guidance says the remedy is to reformat both the operating system and EFI partitions, or restore from a known-clean backup that includes the EFI partition, so reinstalling only the operating system isn't enough.
Pre-installed malware on low-cost Android devices
This is the one that should concern budget hardware shoppers. HUMAN Security found that BADBOX 2.0 backdoors on low-cost, uncertified Android devices, such as TV boxes, tablets, projectors, and car infotainment units, were preinstalled at the factory, downloaded from a command server on first boot, or installed from unofficial app stores. Most of the affected devices were made in China.
A backdoor built into a device's system software isn't removed by a factory reset, because the reset returns the device to that same software. In June 2025 the FBI warned that cheap, mostly China-made streaming boxes, projectors, and similar devices may carry preinstalled or setup-time backdoors. It advised watching for devices that aren't Play Protect certified or that require Play Protect to be turned off, and reporting suspected infections to IC3.
The xHelper Android backdoor
A real-world case: xHelper, an Android backdoor that Kaspersky analyzed in 2020. It posed as a cleaner or speed-up app and, once installed, wrote files into the system partition and marked them with the immutable attribute, so even root couldn't delete them. Kaspersky found those files survived a factory reset, and it considered reflashing the phone the simpler and more reliable fix. Malwarebytes separately observed xHelper re-infecting phones after a factory reset.
Users who didn't understand the mechanism could assume the reset had failed, or that they were being reinfected through their usage habits, when in reality the malware had never left.
Signs your device is still infected after a reset
If you've done a factory reset and something still feels off, pay attention to these signals:
- The same strange apps reappear without you installing them
- Your device runs hot, drains battery quickly, or uses unusual amounts of mobile data
- Pop-ups or redirects return within a day or two
- You get locked out of accounts you didn't access
- Your contacts receive messages you didn't send
These don't prove firmware-level infection on their own, but they're worth taking seriously, especially if you bought a budget device from an unfamiliar brand.
One diagnostic approach, which isn't an official recommendation, is to set the phone up without restoring a backup and to hold off signing in to your accounts for a while. Then watch how it behaves on its own. If apps appear that you didn't install, or if data usage spikes while the device is sitting idle, that's worth investigating. Malware built into a device can reach out to a command server or fetch its components again once the device is online, as HUMAN Security described for BADBOX 2.0.
What to do after a factory reset
A reset is a good first step, not a finish line. Here's how to make sure you're actually protected once you've wiped and started fresh.
Be careful about restoring from a backup. If you suspect stalkerware, the FTC and NNEDV advise against restoring apps from a backup made while the phone was compromised, since that could reinstall it. Download your apps again from the official store instead, and be selective about what you restore.
Only reinstall apps from official stores. The App Store and Google Play aren't perfect, but they're generally safer than third-party sources. Avoid sideloading apps if you can. If you do need to sideload, verify the source carefully and check the app's permissions before granting access to sensitive data.
Update your firmware immediately. Updates can patch vulnerabilities that rootkits and bootkits exploit. The moment your device is back online, check for updates before doing anything else. On Android, this means checking both the Android security patch level and any manufacturer-specific firmware updates. On Windows, this means running Windows Update and also checking your PC manufacturer's support page for UEFI or driver updates.
Change your passwords from a separate, clean device. Your credentials may have been captured before the reset. Change the important ones (email, banking, social media) from a device you trust before logging back into anything on the freshly reset device.
Turn on your built-in protections. On Android, check that Google Play Protect is turned on. On Windows, check that Windows Security is turned on and up to date.
When a factory reset isn't enough
If you believe your device has a firmware-level infection, a factory reset won't cut it. Here's what can work:
- Reflash the firmware from a clean image downloaded directly from the manufacturer's official website, not from a third-party mirror or file-sharing site
- For PCs, run a Windows Security scan first. If the problem persists, Microsoft says to reinstall from installation media with the clean-install option, which can help remove malware. That doesn't touch chip-level firmware, so a suspected firmware implant still needs a manufacturer reflash or help from a professional
- If you bought a budget Android device and suspect it's part of a supply chain compromise, consider disconnecting it, as the FBI suggests for suspect devices, and replacing it with a Play Protect certified device from a reputable manufacturer. You can check certification in the Play Store under your profile > Settings > About, according to Google
These situations are relatively rare for everyday users. The kind of adversary capable of deploying firmware rootkits is typically targeting high-value individuals or organizations, not random consumers. But supply chain compromises like BADBOX 2.0 are an exception to that rule. They affect ordinary people who simply bought an inexpensive device without knowing where it came from.
If you're seeing persistent reinfection after multiple resets, that's a signal worth taking seriously. Document what you're observing, note the device's brand and model, and consider reaching out to a professional security researcher or your device manufacturer's support team before assuming the problem is something you can solve on your own. In the US, you can also report a suspected infected device to the FBI's IC3.
Conclusion
A factory reset removes most viruses and spyware, because most malware lives in apps and user data. It won't remove threats that live in firmware, in a device's system software, or on a PC's boot partition, and it won't help if someone still has access to your accounts. After a reset, install updates, reinstall apps from official stores, and change your passwords from a device you trust.
Guardio doesn't wipe or reset a device, but it covers related risks. Email Security flags phishing emails that get past the Gmail spam filter, Identity Breach Monitoring checks whether your email address or phone number shows up in a known data breach, and browsing protection on your computer and phone blocks phishing and scam sites before they open and explains why. On iPhone, the Text Message Filter sends malicious texts to junk. No tool catches everything.
Get a free security scan with Guardio today and stay protected.
FAQs
Does a factory reset remove all viruses?
A factory reset removes most viruses by erasing user data, including apps, files, and settings, where most malware lives. It doesn't remove threats embedded in firmware, in the device's system software, or on a PC's boot partition. For typical infections, a reset works well. For rare, advanced threats like firmware rootkits, the firmware has to be reflashed or the hardware replaced.
Does a factory reset remove spyware?
Yes, in most cases. Spyware, including stalkerware, keyloggers, and credential stealers installed as apps, is generally erased by a factory reset. There are caveats. If you may be in danger from someone monitoring you, talk to a domestic violence advocate before removing anything, because removal can alert them and deletes evidence. If that person has your iCloud or Google login, they can keep monitoring you after a reset, so change your passwords and check signed-in devices from a safe device.
Can malware survive a factory reset on Android?
Yes. Kaspersky documented the xHelper backdoor, which posed as a cleaner app and wrote files into the Android system partition with an immutable attribute, so they survived factory resets. HUMAN Security found that BADBOX 2.0 backdoors were preinstalled on some cheap, uncertified Android devices, such as TV boxes, tablets, and projectors, or fetched on first boot, which a reset doesn't reliably fix.
Does a factory reset remove viruses on iPhone?
On iPhone, a factory reset is generally effective at removing most infections, and Apple's tight control over its software makes firmware-level infections harder. Sophisticated spyware like Pegasus doesn't come through the App Store. It has used zero-click exploits in iOS apps and services, and Amnesty found that recent infections generally don't persist across reboots, but targets were repeatedly reinfected, including on fully patched phones. A reset wouldn't stop reinfection if the same vulnerability or account access remains. Apple recommends keeping iOS updated and turning on Lockdown Mode if you may be targeted.
Should I factory reset my phone if I think it has a virus?
A factory reset is a reasonable first step when your phone shows clear signs of infection like unexpected apps, unusual data usage, or battery drain. Back up personal data such as photos and contacts, but avoid restoring app data or settings from a phone that may have been compromised. Then reinstall apps manually from official stores, install updates, and change passwords from a separate, trusted device.
What's the difference between a factory reset and wiping a device?
A factory reset restores the device to its original software state, erasing user data while leaving the operating system and firmware in place. On an iPhone, a reset erases the encryption keys, which makes the data unreadable, as Apple's deployment guide describes. Neither a reset nor a wipe removes firmware-level infections, which require reflashing the firmware from a clean, manufacturer-supplied image.
Phishing ScamsHoliday scams 2026: 10 to watch for and how to avoid them





