ELI5: How do computers get viruses?

Explained with your house

Computers get viruses when a person accidentally invites a sneaky, harmful program inside by opening the wrong thing.

Think of your computer like your house. Inside your house, you have your toys, your family photos, and your games. You have a front door that keeps everything safe. A computer virus is like a naughty, messy raccoon that wants to sneak into your house, make a huge mess, break your toys, and hide your favorite things.

The sneaky raccoon cannot just walk through a locked door on its own. It needs someone inside the house to open the door and let it in. In real life, people open the door for a virus in a few common ways:

  • Taking candy from strangers: Imagine someone you do not know knocks on your door and offers you a shiny wrapped present. If you open it, out jumps the raccoon. On a computer, this happens when you click on strange links, open weird emails from people you do not know, or download a free game from a sketchy website.
  • Borrowing dirty toys: If your friend has a bad cold and gives you a toy to play with, you might catch their germs. If someone plugs a USB flash drive into an infected computer and then plugs it into your computer, the virus can jump over and make your computer sick, too.
  • Disguises: Sometimes, the raccoon wears a costume to look like a friendly mail carrier so you will let it inside. A virus might pretend to be a fun movie, an update for your favorite game, or a message saying you won a million dollars. Once you click "yes" to install it, the disguise comes off.

To keep your computer healthy, you need to practice good digital hygiene. You should never open strange packages from people you do not know, always ask a grown-up before downloading something new, and make sure your computer has an antivirus program, which acts like a big, friendly guard dog that barks at the raccoons to scare them away.

Ask your own question

Opens the question on the homepage. Nothing is sent until you press Explain it.

Follow-up questions

Test yourself

Three quick questions to see if it stuck. You can challenge a friend after.