Malware is malicious software designed to harm or exploit a computer or network. A virus is a type of malware that spreads by inserting its code into other programs. Think of malware as the category and virus as a specific item within that category.