What Is a Computer Virus?

Why you can trust SafeWise
products considered
250+
research hours in 25+ in-home tests
10k+
years of combined experience
176+
homes and people protected
10M+

For over 12 years, SafeWise has conducted independent research and testing to write unbiased, human reviews (not robots). Read our methodology.

A computer virus is a malicious program or type of code designed to disrupt the way a computer functions. Viruses are written to spread from one computer to another and to self-replicate. A computer virus works by attaching itself to a legitimate document or program to activate the infected code. If activated, the virus can damage software, corrupt data, or destroy information.

Thwart hackers with the best internet security tips!
Sign up for our free weekly newsletter.

By signing up, you agree to our Terms and Conditions and Privacy Policy.

How do computer viruses attack?

Computer viruses remain dormant until their code is activated. This means viruses can lie in wait—attached to a file or document—until you run the infected program. While the virus is dormant, it can be difficult to detect. But once your computer is infected, any other devices on the same network are also vulnerable to infection.

The amount of devastation varies from virus to virus, but some of the most common things a virus can do are listed below.

  • Log keystrokes
  • Steal passwords
  • Send spam email (with infected code) to your contacts
  • Access and steal data
  • Corrupt files
  • Completely take over your computer

Some computer viruses are designed to create mischief (like turning all of your files into pictures of squid), which is irritating, but usually manageable. But other viruses target financial data or aim to destroy your hard drive.


Compare the best internet security products

Brand
Best for
Starting price
Specs
Standout feature
Learn more
Best identity theft protection

$1 million recovery insurance

Two-factor authentication
Best VPNWorks on 6 devices 5,100 servers

60 countries

Best parental control Unlimited devicesEmail and social media monitoring, powerful parental controls
Best antivirus/malware software Protects up to 10 devices Includes VPN and password manager
Best password manager Unlimited devices with Premium plan VPN and dark web monitoring with Premium plan

Amazon.com price as of post date. Offers and availability may vary by location and are subject to change. Read full disclaimer.
*First year only. Regular price $99.48/yr.
**First year only. Regular price $59.99/yr.

Rebecca Edwards
Written by
Rebecca is the Managing Editor and lead safety expert at SafeWise.com, where she's been researching, testing, and writing about home and personal security for over 12 years. Her safety smarts come from both real life and professional experience—as a single parent trying out safety and security gadgets to protect her family and a former college director responsible for safety plans and strategies to keep buildings, grounds, and hundreds of students and faculty safe every day. With 30 years of experience as a journalist and blogger, she's become a go-to source for trustworthy, practical advice on everything from the best home security systems and smart gadgets to keeping kids safe online, preventing package theft, and understanding crime trends nationwide. PBS NewsHour, The Today Show, NPR, Vice, TechCrunch, The Washington Post, HGTV, Marketplace, On the House, and more have featured Rebecca's expert insights and recommendations. Whether it's protecting your home, your loved ones, or your peace of mind, Rebecca makes safety simple, doable, and real.

Recent Articles

2025 U.S. Package Theft Report and Worst Metro Cities for Porch Pirates
Porch piracy cost $37B this year. See where theft is rising, how it’s changing, and...
SimpliSafe Business Security offers 24/7 monitoring and AI outdoor deterrence, plus a $500 anti-theft reimbursement. Plans start at under $25.
SimpliSafe Rolls Out SMB Security Suite With 24/7 Monitoring
Protect your small business with SimpliSafe’s new SMB Security Suite featuring 24/7 monitoring and AI...
myFirst Fone R2 Review
When your child is too old for a basic GPS tracker but too young for...
The world of social media is overwhelming and worrisome for parents and kids. Image depicts a swirl of social media and input coming at a silhouette of a child in the center. We have solutions to help parents navigate online dangers.
How to Protect Your Kids from Social Media Dangers
Discover the dangers of kids’ social media use and how myFirst Circle offers a safe,...