A virus is a piece of code that can keep duplicating itself in order to corrupt or destroy the data of your system. Whereas a malware or a malicious software trojans, worms, spywares, adwares and also viruses. So we can say that every virus is a malware, but every malware is not a virus.