A virus is a type of malware that inserts itself into a computer program or file and then replicates itself, often causing damage to the computer.