What Is a Computer Virus?

We're constantly warned against the risks posed by computer viruses and the need for protection in the form of anti-virus software.

But what is a computer virus, exactly? And do we really need to worry about it?

A computer virus is a piece of software that makes copies of itself, typically inserting these copies into other programs and files. It's not always malicious, but when it is, it's classified as a form of malicious software, or malware.

Viruses can spread between computers via removable media (such as discs, external hard drives, flash drives, media players and other devices that can store computer files), via the Internet or over a networked system.

A virus will almost always be attached to an executable (.exe) program, or a file designed to be opened by a specific program (for example, a ".doc" file that automatically opens in Microsoft Word. The virus will need the host program to be launched before it can become active — if the program isn't launched, the virus will remain dormant.

When the host program is run on a computer, the virus is run as well. Typically, the host program will continue to run normally, although more virulent infections may damage the program so it doesn't execute properly.

Viruses can have a number of negative effects, sometimes unintentionally. They can damage software so that it no longer runs correctly; erase files; or cause your computer to malfunction, run slowly, crash, reboot at random or break down altogether.

Other forms of malicious software, or "malware," are often referred to as viruses, including worms, rootkits, Trojan horses, spyware and adware. This is a misnomer, however, because these forms of malware behave differently from true viruses.

Anti-virus software can detect and remove viruses after the computer has downloaded or executed an infected file. The most common method of detection involves examining the computer's memory (RAM) and the boot sectors of the hard drive, then comparing their contents against a database of algorithms or hashes (numbers-derived text strings), each of which uniquely identifies a specific virus. These hashes are known as virus signatures.

Anti-virus software may also scan opened files and files sent via email. Anti-virus software needs to be updated regularly to catch new viruses.

Regular backups can also minimize the impact of a viral infection by preventing data loss.

Follow us @tomsguide, on Facebook and on Google+.

TOPICS
Tom's Guide Staff

Tom's Guide upgrades your life by helping you decide what products to buy, finding the best deals and showing you how to get the most out of them and solving problems as they arise. Tom's Guide is here to help you accomplish your goals, find great products without the hassle, get the best deals, discover things others don’t want you to know and save time when problems arise. Visit the About Tom's Guide page for more information and to find out how we test products.

Latest in Online Security
A magnifying glass on top of the Steam logo in a web browser
Valve just pulled a malicious game demo spreading info-stealing malware from Steam
A man filing his taxes electronically on a laptop
AI-powered tax scams are here - how to stay safe from deepfakes, phishing and more this tax season
MacBook Pro 2023
New Mac attack is tricking users into thinking their computer is locked — how to stay safe
Hacker using a stolen social security card
Your Social Security number is a literal gold mine for scammers and identity thieves — here’s how to keep it safe
An open lock depicting a data breach
Half a million teachers hit in major data breach with SSNs, financial data and more exposed — what to do now
Green skull on smartphone screen.
Malicious Android apps with 60 million installs bombarding phones with ads and phishing attacks — how to stay safe
Latest in References
Zoma Boost mattress
What is graphite in a mattress and does your cooling mattress need it?
The Saatva Classic mattress photographed in a stylish white pool room with an indoor river
Do you need a discount code to get the cheapest prices on Saatva mattresses? No and here's why
A mattress placed on a wooden floor with a Tom's Guide Sleep Week 2025 logo in the top left corner
Ditching the bed this World Sleep Day? 3 things you need before putting your mattress on the floor
A woman lies in bed with her hands covering her face, looking upset due to sleep deprivation. A Tom's Guide Sleep Week 2025 graphic, bottom left
Long-term sleep deprivation has serious health risks — but they can be reversed, says expert
Project Astra AI agent
Project Astra — everything you need to know about Google's next-gen smart glasses and new AI assistant
Woman sleeping on her side
How long does it take you to fall asleep? Expert explains 'sleep latency' and what it says about your health
  • IT-Guru-luke
    I got sick of Microsoft Windows viruses and malware
    so I downloaded Robolinux which runs all my Windows apps in either XP or 7, totally 100% immune to viruses and malware. They do this by sandboxing Windows in a revolutionary virtual machine. Robolinux is extremely easy to install and operate. Check it out, its free.
    Reply
  • annoyeddudette
    I am totally pissed off of these viruses, spyware and malware. I have been using laptop since 3 years and installed many antivirus programs on my laptop but nothing work great except Techgenie Antivirus which i recently installed and it works great.
    Reply