The antibiotics most commonly used to treat urinary tract infections include trimethoprim-sulfamethoxazole (Bactrim), nitrofurantoin (Macrobid), fosfomycin, and ciprofloxacin. The choice of antibiotic depends on the specific type of bacteria causing the infection and the patient's medical history. A doctor will prescribe the appropriate antibiotic based on urine test results and other factors.