How Do You Get Worms? Common Causes Explained

Most people get worms by accidentally swallowing microscopic parasite eggs, usually through contaminated hands, food, or water. A few types take a different route, burrowing directly through your skin. Globally, about 1.5 billion people (roughly 24% of the world’s population) are infected with soil-transmitted worms alone, making these among the most common infections on the planet.

The Fecal-Oral Route

The most common way worms spread is deceptively simple: an infected person or animal passes eggs in their stool, those eggs end up on a surface or in soil, and someone else unknowingly transfers them to their mouth. This is called fecal-oral transmission, and it accounts for the majority of intestinal worm infections. The eggs are invisible to the naked eye, so you won’t know they’re there.

This can happen when you touch a contaminated surface (a doorknob, a toilet handle, a shared toy) and then touch your face. It can happen when you eat produce that was grown in contaminated soil or irrigated with untreated water. It can happen when a child plays in dirt and puts their fingers in their mouth. The thread connecting all of these scenarios is the same: trace amounts of fecal matter carrying eggs reach your digestive system.

Pinworms: The Most Contagious Type

Pinworms are the most common worm infection in the United States, especially among school-age children. They spread almost entirely through contaminated surfaces. A female pinworm crawls out of the intestine at night and lays thousands of eggs around the anus, causing intense itching. When a child scratches, the eggs get under their fingernails and transfer to everything they touch: bedding, clothing, toys, countertops.

What makes pinworms so persistent is that their eggs can survive on household surfaces for two to three weeks if not properly cleaned. One child in a household can easily reinfect themselves and spread eggs to every family member. Once swallowed, the eggs hatch and the larvae travel to the lower intestine, where they grow to adult size within two to six weeks before the cycle starts over.

Contaminated Food and Water

Eating undercooked or raw meat is one of the most straightforward ways to pick up a tapeworm. Beef, pork, and freshwater fish can all harbor tapeworm larvae that survive if the meat isn’t cooked to at least 145°F (63°C) internally. Freezing can also kill larvae, but it requires sustained cold: at least negative 4°F (negative 20°C) for a full seven days.

Raw fruits and vegetables pose a different risk. Produce grown in fields fertilized with improperly composted animal manure, irrigated with contaminated river water, or handled by infected workers can carry roundworm, whipworm, and hookworm eggs on the surface. This is a bigger concern in regions where untreated wastewater or animal feces are used in agriculture, but it’s not limited to any one country. Thorough washing helps, though plain water alone may not remove all eggs. Studies on removing roundworm eggs from contaminated surfaces show that detergent-based washing is significantly more effective than water alone.

Walking Barefoot on Contaminated Soil

Hookworms don’t need you to swallow anything. Their larvae live in warm, moist soil contaminated with human or animal feces, and they can penetrate directly through the skin of your feet. You can pick up a hookworm infection simply by walking barefoot on contaminated ground. The larvae burrow through the skin, enter the bloodstream, travel to the lungs, get coughed up and swallowed, and eventually settle in the small intestine. This is most common in tropical and subtropical regions with poor sanitation, where soil stays warm and damp enough for larvae to thrive.

Contact With Pets

Dogs and cats carry their own species of roundworm, and those parasites can spread to humans. The eggs pass in pet feces and can persist in soil, sandboxes, or anywhere an animal has defecated. Children are at the highest risk because they’re more likely to play in contaminated dirt and put their hands in their mouths. In rare cases, people can also get infected by eating undercooked meat from animals like lamb or rabbit that carry the parasite.

Pet roundworm doesn’t typically complete its full lifecycle in humans the way it does in dogs or cats. Instead, the larvae can migrate through tissues like the liver, lungs, or eyes, causing a condition that can lead to vision problems in severe cases. Regular deworming of pets and cleaning up after them promptly reduces the risk substantially.

Swimming in Contaminated Freshwater

One type of parasitic worm, the blood fluke responsible for schistosomiasis, doesn’t need to be swallowed or stepped on. Its larvae develop inside freshwater snails, then leave the snail and swim freely in the water for up to 48 hours. If you wade, swim, or bathe in that water, the parasite can penetrate your skin directly on contact. Schistosomiasis is primarily a concern in parts of Africa, South America, the Caribbean, the Middle East, and Southeast Asia. It does not spread in chlorinated pools or saltwater.

Why Some People Are at Higher Risk

Several factors increase the likelihood of infection. Living in or traveling to areas with limited sanitation infrastructure is the biggest one. Warm, humid climates help eggs and larvae survive longer in the environment. Children are disproportionately affected because they play in soil, have less consistent hand hygiene, and are more likely to put objects in their mouths. People who work with soil, livestock, or raw meat also face higher exposure.

Crowded living conditions make person-to-person spread easier, particularly for pinworms. If one family member is infected, the entire household is typically treated, because the eggs spread so readily through shared linens, bathrooms, and surfaces.

How to Reduce Your Risk

Handwashing is the single most effective defense. Washing with soap and water physically removes parasite eggs from your skin far more effectively than rinsing with water alone. Wash before eating, after using the bathroom, after changing diapers, and after handling soil or pets.

Beyond hand hygiene, a few practical habits make a meaningful difference:

  • Cook meat thoroughly. Use a food thermometer to confirm an internal temperature of at least 145°F for whole cuts of meat and fish.
  • Wash produce well. Scrub firm fruits and vegetables under running water, especially if they were grown in soil or purchased from open-air markets.
  • Wear shoes outdoors. This is particularly important in tropical regions or areas where soil may be contaminated with human or animal waste.
  • Deworm pets regularly. Follow your veterinarian’s recommended schedule and pick up pet waste promptly from yards and public spaces.
  • Wash bedding and clothing in hot water if someone in your household has a pinworm infection, and do so frequently during treatment.
  • Avoid swimming in untreated freshwater in regions where schistosomiasis is present.

Most worm infections are treatable with oral medication that either kills the worms directly or paralyzes them so your body can expel them. Treatment is typically short, often just one to three doses depending on the type of worm. The bigger challenge is preventing reinfection, which requires breaking the cycle of egg transmission in your environment.