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 11 years, SafeWise experts have conducted independent research and testing to create unbiased, human reviews. Learn how we test and review.

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 lead safety reporter and in-house expert for SafeWise.com. She has been a journalist and blogger for over 25 years, with a focus on home and community safety for the past decade. Rebecca spends dozens of hours every month poring over crime and safety reports and spotting trends. Her expertise is sought after by publications, broadcast journalists, non-profit organizations, podcasts, and more. You can find her expert advice and analysis in places like NPR, TechCrunch, The Washington Post, The Chicago Tribune, The Miami Herald, HGTV, MSN, Reader's Digest, Real Simple, and an ever-growing library of podcast, radio and TV clips in the US and abroad.

Recent Articles

""
The Best Home Security Systems in Canada 2025
Learn about 2025's best home security systems for Canada with research from SafeWise experts. From...
SW_Article_Medical Alerts with the Best Battery_Featured image with logo
Best Medical Alert Systems 2025
We researched the best medical alert systems to find reliable options that can empower you...
Man and woman couple wife husband set up surveillance security camera
Best Apartment Security Systems of 2025
In 2025 we tested the best apartment security systems and cameras. They offer security solutions...
diy-security-system-on-ipad
Best DIY Home Security Systems of 2025
SimpliSafe is the best DIY home security system because it's cost-efficient, effective, and easy to...