A person can get tapeworms by eating raw meat from an infected animal or food made by an infected person. Typically, practicing good hygiene is important in preventing the entry of tapeworms into one's body.
A person with tapeworms who doesn't wash his or her hands properly can pass the tapeworms to another person when preparing food or touching eating tools. This leads to one getting the tapeworm eggs, which later develop into larvae. Undercooked or raw meat can also make a person get the larvae, which grow into adult tapeworms later. Adult tapeworms have a length of more than 50 feet and can survive for more than 30 years in a person.