According to the New York State Department of Health, individuals get pinworms by inhaling eggs from the air or ingesting them with their food. The infected individual spreads pinworm eggs when he does not wash his hands after using the bathroom. When he touches another individual or object, he passes on the eggs. Contaminated bedding or clothing also spread the eggs around the home.
Pinworms often spread among children in daycare centers and schools. According to WebMD, pinworm eggs live up to two weeks outside the body. If they are on a counter, towel or other object, they transfer to individuals who touch the contaminated material. Proper hand washing is the best way to prevent the transfer of pinworms from the hands to the mouth.
Doctors diagnose pinworms using a special tape to test for eggs around the anus. Because pinworms spread easily, if a doctor diagnoses one family member with worms, all family members should receive treatment, according to the CDC. The medication requires two doses, spaced two weeks apart. Morning bathing and changing of the underwear washes away the eggs that the female pinworm deposits overnight and decreases the chances of spreading the infection. A second occurrence of pinworms after treatment requires an additional two doses of medication.