What is the difference between a virus and malware?

Updated: 12/10/2023 by Computer Hope
Computer Virus

The term "malware," a portmanteau of the words "malicious" and "software," encompasses many types of harmful programs, including viruses. A virus is a specific type of malware that attaches itself to legitimate software and can replicate and spread when those programs are run (executed).

Like the adage "all squares are rectangles, but not all rectangles are squares," viruses fall under the umbrella of malware. However, malware is not limited to viruses; it includes other items like adware, spyware, ransomware, trojan horses, rootkits, and worms. Consequently, malware became a more common term because it covers various computer threats (such as those mentioned above) rather than only viruses.