A virus is a piece of code that is designed to interfere with the typical performance of a computer. Infections can spread out quickly and trigger considerable damage to both specific computer systems and networks. Some viruses are safe, while others can delete files, corrupt data, or even damage hardware.