Updated: 02/04/2024 by Computer Hope
Robotic bug on a laptop screen.

A computer virus is a malicious program, script, macro, or code designed to damage, steal personal information, modify data, send e-mail, display messages, or a combination of these actions.

When the virus is executed, it spreads by copying itself into or over data files, programs, the hard drive boot sector, or anything else writable. To help spread the virus, writers use knowledge of security vulnerabilities, zero-days, or social engineering to access a host's computer.


Computer virus was featured as a top term in 2003.

How does a computer get a virus?

A computer can become infected with a computer virus or other malware in many ways. When a virus is made, it's often distributed through shareware, pirated software, e-mail, P2P programs, or other programs where users share data. Once downloaded, copied, or otherwise acquired, if the infected program is executed, it can affect anything a computer can access.

Virus protection

How to protect the computer from viruses

You can protect your computer from viruses by installing an antivirus protection program. Once installed on a computer, an antivirus monitors, detects, and cleans any computer viruses by looking for virus signatures.

Alternatively, a user can look at various aspects of the computer and detect possible signs indicating a virus is on the computer. While this method can locate some viruses, it doesn't determine the exact virus you may or may not have and is not recommended.

What can a virus do to a computer?

What a virus does to a computer depends on the type of virus. Most computer viruses delete data, overwrite information, display messages, and add themselves to other files on the computer. Almost all computer viruses only damage the data on the computer and do not physically harm the computer or its hardware. For example, a non-resident virus can infect a specific file, and when accessed, it can spread to other files, corrupting those files and making them unreadable.

Below are some issues the computer may exhibit when infected with a virus. However, realize that many symptoms can also be caused by another computer-related issue, not a virus.

  • Delete some or all files without consent.
  • Cause various error messages in files or on programs.
  • Changes volume label.
  • Marks clusters as bad in the FAT (file allocation table).
  • Randomly overwrites sectors on the hard drive.
  • Replaces the MBR (master boot record) with its own code.
  • Create more than one partition.
  • Access a non-existing drive, causing error messages like: "Invalid drive specification."
  • Causes cross-linked files.
  • Causes a "sector not found" error.
  • Decrease the computer's speed, causing the system to run slow or be low on resources.
  • Create logical partitions or partitions decrease in size.
  • Make directories appear as garbage.
  • Modify the order of execution; for example, cause COM files to start before EXE files.
  • Cause hardware problems such as keyboard keys not working, printer issues, modem issues, etc.
  • Disable ports such as LPT or COM ports.
  • Cause keyboard keys to be remapped.
  • Alter the system time and date.
  • Cause the system to hang or freeze randomly.
  • Randomly cause activity on HDD (hard disk drive) or FDD (floppy disk drive).
  • Increase file size.
  • Change file attributes.
  • Increase or decrease memory size.
  • Randomly change file or memory size.
  • Extend boot times.
  • Erase or completely wipe a drive.
  • Increase disk access times or make the computer always busy.
  • Cause a computer to make strange noises, music, clicking noises, or beeps.
  • Display pictures randomly.
  • Unusual or undocumented error messages.

It is possible for more sophisticated viruses, like Stuxnet, to cause physical damage to components inside the computer or equipment controlled by a computer.

How viruses may affect a file

Viruses can affect any file; however, they usually attack .com, .exe, .sys, .bin, .pdf, .pif, or any data files

Viruses can infect any file, including executable files or data files, such as Microsoft Word documents or Excel spreadsheets. Most viruses target files used frequently to help spread the infection.

Increase the size of files

When infecting files, viruses increase the file size. However, these changes can be hidden with more sophisticated viruses, making detection more difficult.

A virus can delete files as the file is run

Because most files are loaded into memory, once the program is in memory, it can delete the file used to execute the virus to hide its tracks.

It can corrupt files randomly

Some destructive viruses are designed to corrupt, lock, destroy, and delete files, causing some or all data to be lost.

It can cause write-protect errors when executing .exe files from a write-protected disk

Viruses may need to write themselves to executable files; if a diskette is write-protected, you may receive a write-protection error.

It can convert .exe files to .com files

Viruses may use a separate file to run the program and rename the original file to another file extension, so the exe file is run before the com file.

Create copies of files

To help the virus replicate, it may reproduce copies of itself or the files containing the virus throughout the computer.

It can reboot the computer when executed

Numerous computer viruses cause a computer to reboot, freeze, or perform other tasks not normally exhibited by the computer. However, realize that although your computer may exhibit these symptoms, it does not necessarily mean it has a virus.

Computer virus properties

Below are lists of different computer virus properties and each virus property. Realize that not all viruses infections have all of these abilities, and some properties are not listed.

Your computer can be infected even if files are only copied

Because some viruses are memory resident, once in memory (primary storage), they can infect any file or drive (secondary storage or offline storage), even after the infected program is closed.

Illustration of interconnected circles, representing polymorphism.

They can be polymorphic

Some viruses can modify their code, meaning one virus could have many variants. Polymorphic viruses can also change how they're delivered, such as changing the subject or body of the message to help keep them from being detected.

May be a stealth virus

Stealth viruses first attach themselves to other files on the computer before delivering their final payload. This type of tactic allows the virus to spread more rapidly.

Viruses can carry other viruses

Because viruses are only code, they can become infected with other viruses. Consequently, your computer can be infected with multiple viruses and infect a computer with each virus it contains.

It can make the system never show outward signs

Some viruses can hide changes made, such as when a file was last modified, making the virus more difficult to detect.

It can stay on the computer even if the computer is formatted

Some viruses can infect different portions of the computer, such as the master boot record, different partitions, or other areas. Also, if a computer virus is on a backup, it can re-infect the computer when the backup is restored.

Which operating systems are susceptible to viruses?

All operating systems can contract a computer virus or malware. Whether you use Android, iOS, Microsoft Windows, macOS, or a Linux variant, your computer, and its programs or applications can get a virus and other malware.

Examples of computer viruses

Types of viruses

Below are the different types of computer viruses. The following links provide further information about that virus type and its capabilities.

Appending virus
Boot sector virus
Cavity virus
CMOS virus
Companion virus
Encrypted virus
Executable virus
MBR virus
Macro virus
Multipart virus
Non-resident virus
Overwrite virus
Polymorphic virus
Rabbit virus
Resident virus
Spacefiller virus
Stealth virus

Specific viruses

Below is a listing of specific computer viruses with further details. This list is a small subset of the millions of viruses released since the 1980s.

Alive.3400 virus trojan
Badtrans trojan virus
Blaster worm
Cap virus
CIH virus
E-Morph virus
Excel/Laroux virus
Flor virus
KAK virus
Live Stages virus
Lonely hearts trojan virus
Love letter virus
Melissa virus
Mutation virus engine
Nakedwife virus
Nimda virus
NYB virus
OVER 1644 virusResume worm
Satan Bug Natas virus
Sircam virus
Stoned Empire Monkey virus
Sulfnbk virus
VBS/Gnutella worm
VBS/SST@MM script virus

Can a virus physically damage my computer?

As they are only code, viruses and other malware can only affect the data on your computer and cannot physically damage it. However, there are viruses designed to damage equipment connected computers. Stuxnet is one of the most notable viruses capable of damaging hardware, designed to target and enter industrial equipment used with nuclear reactors.

Can a virus infect a CD, DVD, or another disc?

No, a computer virus cannot infect a CD (compact disc) or DVD (digital versatile disc), as CDs or DVDs are locked (read-only) after being created, preventing additional files from being put on that disc. However, if a virus is also copied to it during the creation of the disc, it would become infected.

When was the term "virus" first coined?

John von Neumann first mentioned the concept of a computer program capable of reproducing itself in his 1949 "Theory of Self-Reproducing Automata" essay. His work earned him the unofficial title as "the father of computer virology" or "the father of the computer virus."

Later, Fred Cohen, in 1983, with inspiration from his mentor Leonard Adleman, coined the term virus. In a research paper, Cohen described a virus as "a computer program that can affect other computer programs by modifying them in such a way as to include a (possibly evolved) copy of itself."

What was the first computer virus ever created?

The first computer virus, known as the Elk Cloner, was written (invented) by 15-year-old high school student Rich Skrenta in 1982. The Elk Cloner virus spread to other computers by monitoring the floppy drive and copying itself to any floppy diskette inserted into the computer. Once a floppy was infected, it would infect all other computers that used the diskette. An infected computer would display a short poem on every 50th boot. After this virus and other viruses were discovered, antivirus software was created to help clean the computers from viruses.

How many computer viruses exist today?

The exact number of computer viruses today is complicated, if not impossible, to determine. In 2018, Kaspersky reported an estimated 187 million viruses or related threats, including viruses and threats for computers and mobile devices.

New viruses, either original or variants of existing viruses, are created nearly every day. As such, antivirus companies, including Kaspersky, Symantec, and Trend Micro, update their list of known viruses daily.

What is the difference between malware and a virus?

Malware describes any malicious software, which includes computer viruses. Malware may include spyware, Trojans, worms, or any other software designed with ill-natured intentions. See our malware page for further information.

Computer virus myths

Below are some comments we've encountered that are common misconceptions about computer viruses and other malware.

"If I download a file onto a disk, I don't have to worry about viruses."

A file on a diskette or another drive (e.g., a USB drive) can still be infected. Many viruses are memory resident and capable of loading themselves into memory. Once a diskette is placed in the computer, it could become immediately infected. Anywhere you can save or edit a file, a virus can infect.

"If I buy sealed software, I don't have to worry about viruses."
"If I buy registered software, I don't have to worry about viruses."

A program disc surrounded by plastic doesn't protect it from a virus. When software is saved onto a diskette or disc, the virus could also be saved if that computer is infected. Although software from a developer is rarely infected, it's still possible and has happened.

"If I don't download anything from the Internet, I won't get a virus."

Although many of today's viruses and other malware come from downloading files, it's still possible to get infected without downloading. Also, everything you view on the Internet is downloaded to your computer.

"If I only read my e-mail, I will not have to worry about viruses."

That is not true. Some viruses are distributed through e-mail. Also, files can be attached to e-mail and, if executed, can infect the computer. Today, this is one of the most common ways computer viruses spread around the world.

"If I don't get on the Internet, I don't have to worry about viruses."

Although most viruses spread over the Internet today, a computer virus can infect a diskette, disc, or USB drive. Also, if a computer connects to other computers over a local network, any other computer on the network could be invaded.

"You can contract viruses from looking at web pages."

True. Although it's more common to get viruses and malware from files you download, malware can also be infected upon visiting a website. If a website has a bad ActiveX or JavaScript file, it's possible to spy on your browsing habits and infect the computer with malware and spyware.

"Computer viruses can infect humans."

False. A computer virus cannot infect humans and pose no danger because humans do not run on computer code. However, if the human has a computer-controlled device like a pacemaker, it could be infected if the virus could access that device. So, in this rare situation, the human could technically catch a computer virus, and if the computer-controlled device helped keep that person alive, it could pose a danger to them.

"A virus can infect a computer turned off."

False. Computer viruses are software code, and like other programs you run on a computer, you need a functional computer. A computer that is turned off or not working cannot be infected by a virus.


If only the monitor is turned off, a computer can be infected with a virus since the computer is still working.

What are the advantages and disadvantages of viruses?

If you read everything on this page, you can see numerous disadvantages to computer viruses, including deleting files, crashing computers, and impacting businesses. Computer viruses have no advantages since almost all are malicious or designed to cause the user grief. Although there are funny viruses that are not malicious and vigilante viruses that attack bad people or groups, we still don't consider them an advantage.

What's the difference between a virus and a worm?

A worm self-replicates and executes without any initial interaction from a user. In contrast, a virus requires a user to perform an action (e.g., opening an infected file or installing a program).

What is the full form of "virus," or what is it short for?

The term "virus" is not an acronym. When discussing an antivirus (virus protection), the "anti" is a prefix that indicates a program helps protect against computer viruses.

Adware, Antivirus, Hard drive, Hoax, Infect, Intruder, Logic bomb, Security terms, Software terms, Threat, Trojan horse, Vaccine, Worm, Zoo