How Do You Get Pinworms? Causes, Spread, and Treatment

Pinworms spread through a surprisingly simple route: you swallow their microscopic eggs, usually by touching a contaminated surface and then touching your mouth. The eggs are invisible to the naked eye, survive on surfaces for two to three weeks, and become infectious within just four to six hours of being laid. This makes pinworms the most common intestinal worm infection in developed countries, with prevalence rates between 4% and 28% in children depending on the region.

The Infection Cycle, Step by Step

The whole process starts when you unknowingly swallow pinworm eggs. Once they reach your small intestine, the eggs hatch into larvae. Those larvae travel down to the large intestine, where they mature into adult worms and settle in, typically near the beginning of the colon. From the moment you swallow the eggs to the point where adult female worms are ready to lay their own eggs, about one month passes.

Here’s where the cycle gets self-sustaining. At night, pregnant female worms crawl out of the anus and deposit thousands of eggs on the surrounding skin. This movement is what causes the intense itching that most people associate with pinworms. When you scratch (often in your sleep without realizing it), eggs get trapped under your fingernails and on your fingertips. Touch your mouth, bite your nails, or handle food without washing your hands, and those eggs go right back into your digestive system. The CDC calls this “self-inoculation,” and it’s the single most common way the infection keeps going.

How Eggs Spread to Other People

Pinworm eggs don’t stay on the person who’s infected. They end up on everything that person touches: doorknobs, light switches, toys, tablets, remote controls. Eggs shed onto bedding, pajamas, underwear, and towels overnight. Anyone who touches those surfaces and then touches their mouth can pick up the infection. This is why pinworms tear through households and daycare settings so efficiently. When one family member is infected, multiple members often end up with the infection too.

Eggs can also become airborne in a limited way. When you shake out contaminated bedding or clothing, eggs can briefly float in household dust. If inhaled, they can travel from the airways to the throat and be swallowed, completing the same route into the digestive system. This isn’t the primary way people get infected, but it’s one reason the eggs are so hard to avoid once they’re in a home.

Why Children Are Most Affected

Children between the ages of about 3 and 10 are the most likely to get pinworms, and the reasons are behavioral, not biological. Young kids put their fingers in their mouths constantly, share toys that go from hand to hand to mouth, and are less consistent about handwashing. Classrooms and daycare centers create the perfect conditions: lots of shared surfaces, close physical contact, and dozens of small hands touching everything.

Adults living with infected children frequently catch pinworms too. You don’t need prolonged contact. A single transfer of eggs from a contaminated surface to your mouth is enough.

What the Infection Feels Like

The hallmark symptom is itching around the anus, and it’s almost always worse at night. That timing isn’t random. It’s caused by the female worms physically crawling on the skin to lay eggs while you sleep. Some people also experience restless sleep, irritability (especially children), and mild stomach discomfort. In many cases, though, the infection produces no symptoms at all, which means someone can be spreading eggs around the house without anyone knowing.

If you suspect pinworms, the most reliable way to confirm it is with a tape test. Press a strip of clear adhesive tape against the skin near the anus first thing in the morning, before bathing, using the toilet, or getting dressed. The eggs stick to the tape and can be identified under a microscope. For accuracy, repeat this test on three consecutive mornings, since the worms don’t necessarily lay eggs every single night.

Treatment Takes Two Doses

Pinworm infections are treated with oral medication, and three options are commonly used. All three work by killing the adult worms in the intestine. The critical detail is that none of them kill the eggs. That’s why treatment always involves two doses, with the second given two weeks after the first. By the time you take the second dose, any eggs that survived the first round have hatched into new worms, and the medication wipes those out before they can start laying eggs of their own.

One dose of over-the-counter medication containing pyrantel pamoate is available at most pharmacies without a prescription. The other two options require a prescription. Regardless of which medication is used, treating the entire household at the same time is often recommended, since eggs are likely already on shared surfaces and family members may be carrying the infection without symptoms.

Cleaning Your Home During an Infection

Medication alone won’t end the cycle if your home is still full of viable eggs. Since eggs survive on surfaces for two to three weeks, a thorough cleaning routine during treatment makes a real difference.

  • Bedding and clothing: Wash sheets, blankets, pajamas, underwear, and towels in hot water and machine-dry on high heat. Do this daily during the treatment period, especially for the infected person’s items.
  • Fingernails: Keep them trimmed short. Eggs lodge easily under longer nails, and short nails reduce the number of eggs your hands can carry.
  • Morning showers: Bathing first thing in the morning washes away eggs deposited overnight, before they can spread to clothing and surfaces.
  • Surfaces: Wipe down frequently touched surfaces like toilet seats, faucet handles, and light switches. Avoid shaking out bedding or clothing, which can scatter eggs into the air.
  • Handwashing: Scrub hands thoroughly with soap and warm water after using the bathroom, before meals, and after changing bedding. This single habit is the most effective way to interrupt transmission.

Why Reinfection Is So Common

Pinworms are notoriously stubborn, not because they’re hard to treat, but because reinfection happens so easily. The eggs are microscopic, they become infectious in as little as four to six hours, and they persist on surfaces for weeks. A child who is successfully treated can pick up new eggs from a classmate, a sibling, or a surface that wasn’t cleaned. The scratch-and-swallow cycle can restart before anyone notices symptoms.

If pinworms keep coming back despite treatment and cleaning, it usually means eggs are being reintroduced from somewhere in the environment. Treating all household members simultaneously, maintaining the cleaning routine for at least the full two-week treatment window, and reinforcing handwashing habits with kids are the most practical steps to finally break the cycle.