What is a computer virus? Types and how to avoid them

Computer viruses are malicious programs designed to spread from one device to another, disrupting operations and compromising data along the way. Learn how computer viruses work, warning signs to watch for, and the most common types, to help you stay one step ahead. Then, get Norton AntiVirus Plus to help shield your device against online threats and help protect your digital life.

Person at a desk facing a monitor filled with virus pop‑up warnings.

Computer viruses have been a threat for decades, and they remain a common way for cybercriminals to compromise devices and steal information. They are a type of malware created to replicate and spread themselves across computers. Understanding how viruses spread, what they do once they infect a system, and the warning signs they leave behind can help you recognize threats sooner and reduce the risk of becoming a victim.

How do computer viruses work and spread?

Computer viruses spread digitally from host to host, infecting systems and replicating as they go, similar to how a flu virus spreads through a population. Just as a flu virus relies on a host cell for reproduction, a computer virus requires specific programming, often embedded in files or documents, to replicate and spread through digital systems.

A graphic shows the computer virus lifecycle.
A graphic shows the computer virus lifecycle.
A graphic shows the computer virus lifecycle.

Unlike other forms of malware — an umbrella term for many different types of malicious code — a computer virus spreads by attaching itself to legitimate files or programs and replicating itself across devices.

Here’s how computer viruses work, step by step:

Stage 1: Infection

A computer virus begins by infecting a legitimate file, program, or piece of code. Viruses commonly spread through email attachments, malicious downloads, compromised websites, infected software, and links shared through social media or messaging apps. Because they are often disguised as legitimate content, viruses can infect a device without the user realizing it.

Stage 2: Execution

After infecting a device, a virus may remain dormant until the infected file or program is opened. Once executed, the virus activates and begins running its code. Depending on its design, it may start replicating immediately or wait for specific conditions before carrying out its intended actions.

Stage 3: Spread

Once active, the virus attempts to replicate itself by infecting other files, programs, or devices. As the infection spreads, the virus can also carry out harmful actions such as corrupting data, logging keystrokes, disrupting system performance, or sending spam emails to contacts. While some viruses can be relatively harmless, others can lead to data loss, permanent hard drive damage, or even have financial consequences.

10 Different types of computer viruses

Computer viruses come in many forms, each designed to spread, infect devices, and cause harm in different ways. Some focus on damaging files, while others steal data or disrupt systems. Understanding the most common types of computer viruses can help you recognize potential threats and take steps to protect your devices.

Here’s a closer look at 10 of the most common computer viruses and how they work.

1. Boot sector virus

A boot sector virus infects the part of a storage device responsible for starting your computer. When the system boots, the virus loads into memory before the operating system, allowing it to spread and potentially disrupt normal system functions. These viruses often spread through infected USB drives and other removable media.

2. Resident virus

A resident virus embeds itself in a computer’s memory, allowing it to remain active even after the original infected file is closed, and execute whenever the operating system loads. Once installed, it can infect other files, interfere with system processes, and spread without additional user interaction.

3. Multipartite virus

Multipartite viruses are versatile threats that spread in multiple ways. They can target both program files and system sectors, making them harder to detect and remove than single-target viruses.

4. Macro virus

Macro viruses are written in the macro languages used by applications such as Microsoft Word and Excel. They typically spread through infected documents and activate when the file is opened, allowing the malicious code to execute.

5. Polymorphic virus

A polymorphic virus continually changes its code or appearance to avoid detection by security software. This ability to modify itself makes it particularly challenging for traditional signature-based antivirus programs to identify.

6. File infector virus

A file infector virus attaches itself to executable files and activates when the infected program is run. Once executed, it can replicate, infect additional files, and carry out harmful actions on the affected system.

7. Zeus virus

The Zeus virus is a notorious type of banking malware designed to steal sensitive information, including online banking credentials, passwords, and financial data. It commonly spreads through phishing emails, malicious downloads, and compromised websites.

8. Web scripting virus

Web scripting viruses use malicious scripts embedded in websites or web content to infect visitors. In some cases, simply visiting a compromised website can trigger malicious activity, such as data theft, browser manipulation, or the installation of additional malware.

9. Direct action virus

A direct action virus activates only when an infected file is executed. Unlike resident viruses, it does not remain in memory after completing its task, instead infecting selected files and then becoming inactive until triggered again.

10. Browser hijacker

A browser hijacker modifies browser settings without the user’s permission. It may change your homepage, redirect searches, display unwanted advertisements, or send you to potentially unsafe websites, compromising both your privacy and browsing experience.

What are the signs of a computer virus?

Computer viruses don’t always announce their presence, but many leave behind clues that something isn’t right. Changes in performance, unusual system behavior, and unexpected pop-ups can all signal that malware has found its way onto your device.

While these computer virus warning signs don’t always indicate an infection, they are often worth investigating — especially if several appear at once:

  • Frequent pop-ups: Persistent or suspicious pop-up windows might urge you to visit unsafe websites or download fake antivirus software.
  • Sluggish performance: If your computer suddenly becomes noticeably slower, a virus may be consuming system resources in the background.
  • Unexpected crashes or freezes: Frequent system crashes, freezes, or error messages such as the blue screen of death can indicate that malware is interfering with normal system operations.
  • Unknown programs or files: New applications, desktop icons, browser extensions, or files appearing without your knowledge may signal that malicious software has been installed.
  • Unexplained password changes: Being locked out of accounts or discovering that login credentials have changed without your involvement could indicate that malware has compromised your device or accounts.
  • Unauthorized settings changes: Changes to your homepage, security settings, browser preferences, or other system configurations that you didn’t make may suggest that a virus is actively modifying your device.
An illustration showing six common symptoms of a computer virus.
An illustration showing six common symptoms of a computer virus.
An illustration showing six common symptoms of a computer virus.

Prevention checklist: How to avoid computer viruses

The best way to deal with a computer virus is to prevent an infection from happening in the first place. A combination of good security habits, regular software maintenance, and reliable antivirus software can significantly reduce your risk. Use the following checklist to help keep your devices and personal information safe:

  • Use reliable antivirus software: Trusted security solutions such as Norton AntiVirus Plus can help detect, block, and remove known threats and use advanced heuristic scanning to protect against emerging malware.
  • Enable automatic scanning: Configure your antivirus software to automatically scan downloaded files, email attachments, and other potentially risky content before they can run on your device.
  • Keep software up to date: Regularly updating your operating system, web browsers, and applications helps patch security vulnerabilities that cybercriminals may try to exploit.
  • Be wary of email attachments: Avoid opening attachments or clicking links from unknown or suspicious senders. When in doubt, verify the sender before interacting with the message to help avoid falling for phishing attacks.
  • Avoid suspicious pop-ups: Unexpected pop-ups may be used to distribute malware or direct you to unsafe websites. Close suspicious pop-ups without clicking them and avoid unsafe or dangerous websites known for aggressive advertising or questionable content.
  • Download from trusted sources: Only install software, apps, and files from reputable websites, official app stores, or verified publishers. Scan downloaded files before opening them whenever possible.
  • Back up important data: Regularly back up important files to an external drive or secure cloud storage service. Backups can help minimize data loss if your device becomes infected or compromised.

If your device does become infected, a reputable virus removal tool can help detect and eliminate malicious software. Combining strong prevention habits with reliable security software provides the best protection against computer viruses and other online threats.

Defend your digital space with Norton

Understanding how viruses spread is the first step toward staying protected. Good security habits — like keeping software updated, avoiding suspicious downloads, and backing up important files — can go a long way toward reducing your risk. But with new threats emerging every day, prevention alone isn’t always enough.

Norton AntiVirus Plus provides real-time protection against viruses, malware, ransomware, and other online threats, helping stop attacks before they can compromise your device or data. With automatic updates and powerful threat detection working in the background, you can browse, work, and connect with greater confidence.

FAQs

How do I get rid of a computer virus?

To remove a computer virus, run a full system scan using a reputable antivirus or malware removal tool. These programs can identify, quarantine, and remove malicious files while helping restore your device's security and performance.

Can Macs get viruses?

Yes, Macs can get viruses, although they are less frequently targeted than Windows computers. Viruses and other types of malware can spread through infected downloads, email attachments, compromised websites, and malicious software, making security precautions just as important for Mac users.

Is ransomware a virus?

No, ransomware is not a virus. It is a type of malware that encrypts a victim’s files and demands payment in exchange for restoring access. While ransomware can be just as damaging as a virus, it does not spread by infecting other files in the same way a traditional computer virus does.

Is a Trojan a virus

No, a Trojan is not a virus. A Trojan is a type of malware that disguises itself as legitimate software to trick users into installing it. Unlike viruses, Trojans do not self-replicate or spread by infecting other files.

What kind of damage can a computer virus do?

A computer virus can corrupt or delete files, slow down system performance, steal sensitive information, disrupt normal operations, and, in severe cases, render a device unusable.

What is the worst computer virus?

There is no single “worst” computer virus, but some of the most damaging include Mydoom, ILOVEYOU, and Conficker. These outbreaks infected millions of devices worldwide, caused widespread disruption, and resulted in billions of dollars in damages.

Luis Corrons
Luis Corrons is a Security Evangelist for Gen (Avast, AVG, Avira, Norton) & leads boards at AMTSO & MUTE. He is a prominent speaker at industry events.

Editors’  note: Our articles offer educational information and are written to raise awareness about important topics in Cyber Safety. Norton products and services may not protect against every type of threat, fraud, or crime we write about. For more details about how we research, write, and review our articles, see our Editorial Policy.


Want more?

Follow us for all the latest news, tips, and updates.

Protect against computer viruses

Get Norton AntiVirus Plus to help block viruses, prevent malware, and protect your personal information.

Protect against computer viruses

Get Norton AntiVirus Plus to help block viruses and protect your personal information.

Norton

AntiVirus Plus