Bacteria cause urinary tract infections (UTIs), so antibiotics are the first-line treatment. Even when symptoms disappear, a person should finish their antibiotic course according to their doctor’s guidance.

If a person stops taking antibiotics midway through the course, the bacteria causing the infection may multiply, and symptoms may return.

People respond to antibiotics differently, especially if they have any underlying health conditions. For example, if they have diabetes or a severe UTI, they may need a longer or stronger course of antibiotics.

Without proper treatment, a UTI can move further up the urinary tract and affect the kidneys. When this happens, a person will likely develop more serious symptoms. Sometimes, this type of infection can be fatal.

This article examines the types of antibiotics used for UTIs and their side effects. It also discusses other UTI treatments, self-care, and prevention. Finally, it advises about when to speak with a healthcare professional.

A hand holding a medication blister pack 1Share on Pinterest
Guido Mieth/Getty Images

The type of antibiotic a person receives for a UTI depends on whether it is complicated or uncomplicated.

Uncomplicated UTIs are widespread and tend to develop in people without underlying health conditions. Other names for an uncomplicated UTI are lower tract UTI or cystitis. Sometimes, uncomplicated UTIs resolve on their own without the need for antibiotics.

Complicated UTIs, however, can cause serious complications, such as sepsis. Sometimes, they can be fatal. This type of UTI is more common in people who are staying in the hospital, particularly those who have had a urinary catheter fitted or have a weakened immune system.

Doctors may use several different types of antibiotics to treat uncomplicated UTIs. We outline some examples in the table below.

Type of antibioticTypical course
Nitrofurantoin5–7 days
Sulfamethoxazole/trimethoprim (Bactrim)3 days
Fosfomycin2–4 days
First-generation cephalosporins3 days

For complicated UTIs or those with severe symptoms, a person may receive broad-spectrum antibiotics, including:

  • penicillins
  • beta-lactams
  • cephalosporins
  • fluoroquinolones, like ciproflaxin (Cipro)
  • carbapenems

Once a doctor knows the specific type of bacteria causing the UTI, they can switch to a more targeted antibiotic. Typically, the antibiotic course for complicated UTIs is 10 to 14 days.

Learn more about stopping a chronic UTI.

Antibiotics for UTIs can have side effects, including:

More serious risks may include:

The Centers for Disease Control and Prevention (CDC) notes that if a person needs antibiotics, the benefits of using the medication typically outweigh the risks.

Learn more about the side effects of antibiotics.

Alongside antibiotics, a healthcare professional may recommend phenazopyridine, which is a type of pain medication.

While phenazopyridine does not treat the underlying infection, it helps relieve symptoms that may cause discomfort and pain.

Potential side effects include:

Learn about the best medications for a UTI.

The United Kingdom’s National Health Service (NHS) suggests that the following tips may help ease UTI symptoms:

  • rest
  • drink plenty of fluids to help pass pale urine regularly during the day
  • avoid sexual activity
  • adults can take acetaminophen up to 4 times a day to help reduce pain and fever; children can have liquid acetaminophen

Learn about testing for and treating UTIs.

Ways to prevent a UTI include:

  • Urinating after sexual activity: Urinating before and after sexual activity helps flush bacteria out of the urethra, preventing it from spreading and causing an infection.
  • Showering: Taking a shower instead of a bath may reduce the likelihood of developing a UTI because the bacteria and dirt from the skin cannot reach the urethra as easily.
  • Wiping from front to back: For females, wiping from front to back after urinating or having a bowel movement prevents bacteria from the rectum from entering the urethra.
  • Wearing loose-fitting clothes: Loose, breathable clothes made from natural fabrics, such as cotton, helps keep the area around the urethra cool, preventing bacterial growth.
  • Fully emptying the bladder: Holding in urine or not fully emptying the bladder may increase the likelihood of developing a UTI.

Learn about some home remedies to treat a UTI.

A person should visit their doctor if:

  • the UTI keeps recurring
  • symptoms are taking longer than expected to resolve
  • symptoms are worsening
  • different symptoms are presenting

Learn more about the signs and symptoms of a UTI.

Antibiotics treat UTIs. However, the antibiotic a person receives depends on the type of infection they have. For example, doctors may treat an uncomplicated UTI with nitrofurantoin and use carbapenem for a complicated UTI.

In addition to antibiotics, a person may also receive phenazopyridine. This is a type of pain medication that may help reduce UTI symptoms and discomfort.

People can take steps to help prevent UTIs, such as taking showers instead of baths, urinating after sexual activity, and wiping from front to back.

If a person is not seeing any improvement in their symptoms after taking antibiotics, they should speak with a healthcare professional.