Trimethoprim (TMP) is an antibiotic that is mainly used to treat bladder infections. Other uses include middle ear infections and traveler's diarrhea. In combination with sulfamethoxazole or dapsone, it can be used for pneumocystis pneumonia in people with HIV/AIDS. It is taken by mouth. Trimethoprim is on the WHO essential medicines list and requires a prescription.