Malware is the umbrella term for any malicious software built to harm a device, steal data or give an attacker access without permission. A virus is one specific type of malware that attaches itself to a legitimate file or program and copies itself into other files when that host file runs. Every virus is malware, but not every malware is a virus: ransomware, trojans, worms, spyware and rootkits are malware that spread and act differently.
Key takeaways
- Malware is the category; a virus is one member of it, defined by self-replication through a host file.
- Most modern infections are not classic viruses at all, but ransomware, infostealers, trojans and worms.
- The type of infection changes the response: a virus needs host cleanup, a worm needs propagation stopped, and an infostealer needs passwords rotated.
People say "my computer has a virus" for almost any infection. Technically, that is usually wrong, and the distinction matters, because the type of malware decides how it spreads, what it does, and how you get rid of it.
What is malware?
Malware, short for malicious software, is any software or code built to act against the owner's interests: steal data, encrypt files for ransom, give an attacker remote control, spy on a user, mine cryptocurrency, or destroy systems outright.
The definition rests on intent and permission. A disk-wiping tool you run on purpose is a tool. The same wiping behavior triggered on your server by an attacker is malware. The code can be identical; what makes it malware is that it runs without consent and serves someone else's goal.
Malware is the umbrella term. Under it sit viruses, worms, trojans, ransomware, spyware, adware, rootkits, keyloggers, infostealers and fileless malware. CISA describes malware as software designed to disrupt, damage or gain unauthorized access to a computer system.
What is a virus?
A computer virus is a piece of malicious code that attaches itself to a legitimate file or program and replicates by inserting copies of itself into other files when the infected host is executed.
A virus needs a host. It does not exist as a standalone program. It rides inside another file, a document, an executable, a script or a boot sector, and it runs when that file runs. That self-replication through a host file is what makes it a virus, and nothing else.
Early malware in the 1970s and 1980s was mostly this kind, which is why the word virus stuck in everyday language. Classic examples include boot-sector viruses that infected a disk's startup code, file infectors that attached to programs, and macro viruses that hid in office documents.
Virus vs malware: what is the difference?
The difference is hierarchy, not rivalry. Malware is the set, and a virus is one member of it. Every virus is malware, but most malware today is not a virus, and treating every infection as a virus leads to the wrong response.
| Malware (the category) | Virus (one type) | |
|---|---|---|
| Definition | Any code built to do harm without permission | Malware that self-replicates through a host file |
| Needs a host file? | No, many types run standalone | Yes, by definition |
| Self-replicates? | Some types do, most do not | Yes, that is what makes it a virus |
| Needs user action? | Varies by type | Yes, the infected file must run |
| Examples | Ransomware, trojans, worms, spyware, rootkits | Boot-sector, file-infector and macro viruses |
| Main goal | Steal, encrypt, spy, control or destroy | Spread, then carry out its payload |
Think of it like squares and rectangles: all squares are rectangles, but not all rectangles are squares. Avast makes the same point, noting that all viruses are malware, but not all malware is a virus.
What are the main types of malware?
Most infections you will meet today are not classic viruses. They are other types of malware, each with its own spread and goal, and each needing a different response.
Worm
A worm self-replicates like a virus, but it does not need a host file or a user to run it. It moves from device to device over a network, often by exploiting a vulnerability. A worm's main job is propagation, though it can carry a payload too.
Trojan
A trojan pretends to be legitimate software, such as a free game, a cracked app or a fake update, and the user installs it willingly. Once inside, it opens a back door, steals data or downloads more malware. Unlike a virus, it does not copy itself into other files.
Ransomware
Ransomware encrypts your files and demands payment for the decryption key. It usually arrives through phishing, stolen credentials or an exploited flaw. The FBI's 2025 Internet Crime Report recorded ransomware among the most costly complaint types, and paying does not guarantee your files come back.
Spyware and infostealers
Spyware watches what you do and sends it to an attacker: keystrokes, screenshots, browsing, and saved passwords. Infostealers specialize in stealing credentials and session cookies from browsers and apps. These infections are quiet by design, so you may not notice them for months.
Rootkit
A rootkit hides deep in the system, often at the operating system level, so that other malware can run unseen. It is hard to detect and hard to remove, because it can hide its own files and processes from security tools.
Adware and fileless malware
Adware floods you with ads to earn revenue, and sometimes tracks you as well. Fileless malware runs in memory without writing a file to disk, using tools already on the system, which makes it harder for traditional antivirus to catch.
How do viruses and malware spread?
Viruses spread when an infected file is opened or shared: an email attachment, a downloaded program, a document with macros, or a USB drive. The user has to run the host file, which is why social engineering and shared files are the classic virus routes.
Other malware spreads in more ways. Worms move across networks on their own. Trojans arrive as fake software. Ransomware often starts with a phishing email or a stolen remote-desktop password. Infostealers spread through malicious downloads and cracked software. A zero-day attack can deliver malware through a flaw nobody has patched yet.
That variety is why one defense is not enough. You need updated software, a firewall, email filtering, and the habit of not opening attachments or downloading software from untrusted sources. Our guide to how to secure your Wi-Fi covers the network side, including keeping smart devices separate from your main computers.
What are the signs of a virus or malware infection?
The signs overlap across types, so symptoms alone rarely tell you which malware you have. They do tell you to act, and a scan plus a check of recent changes usually narrows it down.
- Slow performance and crashes. Programs freeze, the computer takes far longer to start, or apps close without warning.
- Pop-ups and new toolbars. Ads appear even when the browser is closed, or your home page and search engine change without you changing them.
- Apps you did not install. New programs, browser extensions or phone apps appear that you do not recognize.
- Unusual network or battery use. Data or battery drains fast, or the device is busy when you are not using it.
- Files change or vanish. Files are renamed, encrypted, or replaced, or ransom notes appear.
- Accounts act strangely. Passwords stop working, contacts get spam from you, or logins appear from places you have never been.
If several of these appear together, treat the device as infected until a scan proves otherwise. On a phone, compare the signs with our guide on how to know if your phone is hacked.
Which is worse: a virus or other malware?
There is no single answer, because the damage depends on what the malware does, not on its category. A simple virus that deletes a few files can be less harmful than ransomware that encrypts a business, or an infostealer that quietly sends every password to an attacker.
CrowdStrike notes that viruses are usually dormant until the victim activates them, while other malware often works to keep persistent access and communicate back to its sender. A quiet infostealer can be worse than a noisy virus, precisely because it stays hidden while it steals.
The practical question is not which label is worse, but what the infection can reach: your files, your passwords, your bank, or your whole network. That is what decides how urgent the response is.
How do you remove a virus or malware?
Removal starts the same way for most infections, then diverges by type. Do not just delete the suspicious file and hope for the best, because many types leave behind scheduled tasks, registry changes or a second payload.
- Disconnect from the network. Unplug Ethernet or turn off Wi-Fi, so the malware cannot spread or send data out.
- Run a full scan with updated security software. Use a reputable tool, update it first, and run a full scan rather than a quick one.
- Follow the tool's removal steps, then scan again. If it finds something, let it quarantine or remove it, then run a second scan to confirm.
- Use an offline or rescue scan if it persists. Some infections resist removal while the system is running; a boot-time or rescue scan runs before they load.
- Change passwords from a clean device. If an infostealer may have been involved, change email, banking and other important passwords, and turn on multi-factor authentication. Check first whether any of them leaked with our guide to checking if your password was leaked.
- Reset and restore if needed. If removal fails, back up your files, reset the device, and restore from a backup made before the infection.
For ransomware, do not pay as a first step. Isolate the device, report the incident, and check whether a free decryptor exists for that strain before you consider any other option. Restore from offline backups where you can.
How do you prevent viruses and malware?
Prevention is mostly habits plus updates. Keep your operating system, browser and apps updated, because most malware uses known flaws that already have patches. Use reputable security software and keep it updated, and keep a firewall on.
Be careful with the two most common entry points: email and downloads. Do not open attachments you did not expect, even from people you know, and download software only from the vendor's own site or the official app store. Back up important files regularly to a drive you disconnect afterwards, so ransomware cannot reach the backup too.
For a team, the same habits scale into policy: managed updates, email filtering, least-privilege accounts, and a written response plan. Our small business cybersecurity checklist puts those controls in one list you can work through.
The bottom line
Malware is the umbrella, and a virus is one type under it. Most of what people call a virus today is actually ransomware, a trojan, an infostealer or a worm, and each one needs a slightly different cleanup.
Learn the signs, scan when something feels wrong, and change passwords from a clean device after any infection. You can start by checking your own exposure with the free pwned password checker, and by making sure your backups and updates are in place before the next infection arrives.
Frequently asked questions
Is a virus the same as malware?
No. Malware is the general term for all malicious software. A virus is one specific type of malware that spreads by attaching to files and copying itself when those files run. All viruses are malware, but most malware is not a virus.
Which is worse, a virus or malware?
It depends on the type. A simple virus that deletes files can be less damaging than ransomware that encrypts your whole business, or an infostealer that quietly sends your passwords to an attacker. Judge the threat by what it does, not by whether it is called a virus.
Can my phone get a virus?
A classic file-infecting virus is rare on a modern phone, but phones do get malware, including spyware, adware, banking trojans and fake apps. Keep your phone updated, install apps only from the official store, and check for the warning signs in our guide to spotting a hacked phone.
How do I know if I have a virus or other malware?
Look for slow performance, crashes, pop-ups, new toolbars or apps you did not install, changed browser settings, and battery or data use that jumps for no reason. Run a full scan with reputable security software, and if the scan finds nothing but symptoms continue, get help rather than ignoring it.
How do I remove malware from my computer?
Disconnect from the network, run a full scan with updated security software, and follow its removal steps. If the infection persists, use your security vendor's offline or rescue scan, or reset the device and restore from a clean backup. Change passwords from a clean device afterwards.
Do I still need antivirus if viruses are rare now?
Yes. Modern security software protects against far more than classic viruses: ransomware, phishing pages, malicious downloads and suspicious behavior. Keep it updated, keep your system updated, and do not rely on antivirus alone.
Is ransomware a virus?
No, ransomware is a type of malware, not a virus, unless it also self-replicates through host files. Most ransomware arrives by phishing, stolen credentials or an exploited vulnerability, then encrypts files and demands payment for the decryption key.
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 CrowdStrike, Avast and CISA definitions of malware and viruses, and MITRE ATT&CK technique descriptions.
How we write and fact-check →