First: take a breath. Actually seeing a worm is alarming, but it's also the one clear sign that a doctor can act on quickly. Here's what the common types look like, what often gets mistaken for a worm, and what to do.
Tapeworm segments — flat, pale, rectangular pieces that can look like grains of white rice, sometimes moving.
Roundworms — larger and rounder, pale, and can look a bit like earthworms or cooked spaghetti.
Often mistaken for worms: undigested food (bean sprouts, noodle bits), mucus strands, or fibers. If you're unsure, that's exactly what a stool test is for — you don't have to be certain to get checked.
What to do next
See a doctor — a visible worm is worth a call. Many worm infections are treated with a simple course of medication.
If you can, take a clear photo — it genuinely helps identification. If you want to keep the specimen itself, ask the clinic how they want it collected and transported; labs may need a particular container or preservative.
Wash hands and launder bedding — pinworms especially spread easily at home, so treatment often covers the whole household.
Bottom line: seeing a worm means see a doctor — not panic. Most are common and treatable, and a professional can confirm the type and prescribe the right treatment. This page is general information, not a diagnosis.