Diagnosis is typically made through direct observation or the "tape test." This involves pressing a piece of clear tape against the anal area in the morning before bathing or using the toilet. The tape is then examined under a microscope for the presence of pinworm eggs. A healthcare provider may also perform a visual inspection or use other diagnostic tests if necessary.