Malware is the broad category covering any software built to damage, disrupt or gain unauthorised access to a system, while a virus is one particular kind of malware that spreads by attaching itself and moving from computer to computer. Every virus is malware, but not every piece of malware is a virus.
The core difference
Malware is the umbrella term; a virus is one specific type of malware that spreads between machines.
- malware — software deliberately created to damage, disrupt, or gain unauthorised access to a system: the email attachment installed malware on her laptop.
- virus — malicious software that spreads between computers, often damaging files or data: her laptop got a virus after she opened an email attachment.
How to tell them apart
A helpful memory hook is that malware is a family name and virus is one member of that family, in the same way a virus in medicine is one kind of infectious agent among many. Malware is a blend of "malicious" and "software", and it covers anything harmful, whether it spreads on its own or not. A virus specifically spreads, moving from one computer to another, often by attaching itself to files or programs that get shared.
The mix-up usually happens in everyday speech, where people call any infection on their computer "a virus" even when it is a different kind of malware entirely. IT teams and security software tend to be more precise, reserving "virus" for the spreading kind and using "malware" when describing the wider threat that has been found or removed.