Short answer

Malware is a broad term for any software intended to compromise computers or their users, including theft, disruption, or extortion, while a computer virus is a specific kind of malware that self-replicates and spreads by attaching itself to other programs or files. 1 2

A computer virus is a subtype of malware, defined by its self-replicating method of propagation.

On this page

At a glance

QuestionMalwareComputer virus
CategoryGeneral harmful softwareSelf-replicating malware
PropagationMay use any methodSpreads by attaching to files/programs
ScopeIncludes many typesOne specific type

The table summarizes the stated definitions and scope. 1 2

What each thing is

Malware. Malware is any software designed to cause harm to a computer system, its data, or its users, regardless of how it spreads or operates. 1

Computer virus. A computer virus is a type of malware that can replicate itself and spread to other programs or files, often requiring user action to activate. 2

Key differences

The main technical difference is that malware refers to any software with malicious intent, while a computer virus specifically describes malicious code that can copy itself and infect other files or programs. 1 2

How to tell them apart

To distinguish them in practice, check if the harmful software spreads by copying itself into other files or programs. If so, it is a virus; if not, it may be another form of malware. Some malware types do not replicate this way. 2

Where they overlap

Both malware and computer viruses can damage files, steal information, or disrupt operations. All viruses are malware, but not all malware uses the self-replicating technique that defines a virus. 1 2

Edge cases

A tricky case arises with malware that spreads automatically but does not attach itself to files, such as certain worms. These are malware, but not classified as viruses because they do not use the virus propagation method. 1 2

Why the distinction exists

The distinction exists because early malicious programs were often viruses, but as threats evolved, new forms of malware emerged that did not fit the virus definition. This led to the need for a broader category. 1 2

Common misconceptions

A common misconception is that all malware is a virus. In reality, viruses are just one type of malware, and many malicious programs do not replicate by infecting other files. 1 2

Examples

If a program deletes files and spreads by copying itself into other applications, it is a computer virus. If it simply deletes files without self-replication, it is malware but not a virus. 1 2

  • phishing vs spam
  • hardware vs software
  • antimicrobial vs antibiotic

Sources

Sources checked October 3, 2026.

  1. NIST CSRC — Malware. Malware definition.
  2. NIST CSRC — Virus. Computer virus definition.

Research and drafting are AI-assisted, with citations beside the claims they support. The founder reviews each article before it is selected. This is editorial review, not specialist certification. About WhatDiffers

Report an error