Key takeaways:
Urinary tract infections (UTIs) are common during pregnancy. But they need to be treated with antibiotics as soon as possible so they don’t turn into a more serious infection.
Amoxicillin and cephalexin are usually the first-choice antibiotics for a UTI during pregnancy.
A properly treated UTI usually doesn’t cause any lasting harm to you or your growing baby.
Save on related medications
If you've ever had a urinary tract infection (UTI), you know that it’s usually treated with antibiotics. But if you’re pregnant and have symptoms of a UTI, you may be wondering: Is it safe to take antibiotics for a UTI while pregnant?
Here's what to know about which antibiotics are safe for a UTI during pregnancy, which ones are usually avoided, and what you can do at home while you wait for your treatment to work.
Which antibiotics are safe during pregnancy?
There are antibiotics for UTIs that are safe to take during pregnancy. These antibiotics tend to be older and very well studied, so there’s a lot of information showing that they’re safe. In fact, they’re prescribed for UTIs during pregnancy even if you have no symptoms. That’s because untreated UTIs in pregnancy can spread to the kidneys and raise the risk of preterm labor.
Search and compare options
Your healthcare team will choose the right antibiotic for you based on how far along you are in your pregnancy and which bacteria is causing your infection.
These antibiotics need to be taken for longer than the usual course of 3 to 5 days (or fewer).
No matter which antibiotic your prescriber gives you, it’s important to finish the entire course — even if you start to feel better. If you don't finish your antibiotics, the infection could come back and be resistant (immune) to antibiotics.
Cephalexin
Cephalexin may be a first-choice antibiotic for UTIs during pregnancy. And it’s generally considered safe throughout pregnancy as well. Cephalexin is usually taken 4 times per day for 5 to 7 days.
Cephalexin is part of the cephalosporins antibiotic family. Sometimes, other cephalosporins, like cefuroxime and cefpodoxime, can be used to treat a UTI during pregnancy.
Nitrofurantoin (Macrobid)
Nitrofurantoin is one of the most effective antibiotics for UTIs during pregnancy, and it's often the first one prescribers choose. Very few bacteria have become resistant to it, and it concentrates right where it's needed: in the bladder. It's usually taken twice a day for 5 to 7 days.
Some older studies raised questions about birth defects when nitrofurantoin was used in the first trimester, but the findings were mixed and hard to interpret. A large 2025 study of more than 71,000 pregnancies found no increased risk with nitrofurantoin compared with penicillin-type antibiotics. So, nitrofurantoin is considered a reasonable option for most people, and a healthcare professional may prescribe it for you.
Sulfamethoxazole / trimethoprim (Bactrim)
Like nitrofurantoin, sulfamethoxazole / trimethoprim (Bactrim) has conflicting information on how safe it is in the first trimester. It’s typically avoided during pregnancy, unless there are no other options. But it’s considered a reasonable choice if needed.
Amoxicillin
Amoxicillin is part of the penicillin family of antibiotics, and it's considered safe throughout pregnancy. It’s usually not a first-choice antibiotic for UTIs, though, because there’s a lot of resistance to the medication.
But it can still be a great choice if a urine culture shows that it will work against the bacteria causing your particular infection. Sometimes, healthcare professionals prescribe amoxicillin / clavulanic acid (Augmentin) instead. This is a combination medication that can work better against some bacteria.
Amoxicillin and Augmentin are usually taken 2 to 3 times per day for 5 to 7 days.
Which antibiotics are NOT safe during pregnancy?
Some antibiotics that are commonly used to treat UTIs — like fluoroquinolones — can’t be taken during pregnancy. Fluoroquinolone antibiotics, like ciprofloxacin and levofloxacin, are popular treatments for UTIs outside of pregnancy. But they aren't used much during pregnancy because they’re linked to an increased risk of defects. Some studies have reported that these risks are low because the medications are only taken for a few days. But it’s best to avoid them unless there are no other options.
What else can you do to treat a UTI when you’re pregnant?
Antibiotics for a UTI take time to start working. You might be wondering if there’s anything you can do to relieve your symptoms while you wait.
Here are some things that can help you stay comfortable and keep you from developing another UTI:
Drink plenty of fluids to help flush bacteria out of your urinary system.
Limit caffeine because it can make you dehydrated.
Avoid sex while being treated for a UTI.
Avoid tight-fitting pants.
Wear cotton underwear.
Don't soak in a bath for longer than 30 minutes in a day or more than twice a day.
Take acetaminophen (Tylenol) to help with pain relief. When pregnant, don’t take nonsteroidal anti-inflammatory drugs (NSAIDs), like ibuprofen (Advil, Motrin) and naproxen (Aleve).
Can you take AZO while pregnant?
Yes, phenazopyridine (AZO) is generally considered safe to use in pregnancy. It’s a medication that’s used to relieve UTI symptoms of burning, frequency, and urgency. In studies, phenazopyridine wasn’t linked to any birth defects.
It’s important to remember that this medication doesn’t cure the infection. But it may help you feel more comfortable until your infection is treated with antibiotics.
Frequently asked questions
No, a urinary tract infection (UTI) should always be treated with antibiotics while pregnant. Bacteria in the urine that go untreated can progress to a kidney infection — which is much more serious and may require hospitalization. Fluids, cranberry products, and over-the-counter (OTC) remedies won't clear a UTI, but you may be able to use them along with your antibiotics.
There aren’t adequate studies on the safety of antibiotic ointments in pregnant women.
Generally speaking, antibiotic ointments aren’t absorbed into the bloodstream like those taken by mouth, so they likely carry far less risk in pregnancy. That being said, antibiotic ointments like mupirocin (Bactroban) are only advised by healthcare professionals when absolutely needed. Talk to a healthcare professional before using any antibiotics in pregnancy.
One thing to know: An ointment won't do anything for a UTI. Skin antibiotics don't reach the urinary tract, so a UTI still needs an oral antibiotic.
Antibiotics can begin to work within hours, but most people don’t start feeling better until a day or two after the first dose. But it’s important to finish the full course anyway — even once symptoms fade — to keep the infection from coming back. Call your prescriber in these cases:
You're not improving after 2 to 3 days.
You develop a fever, chills, back pain, or nausea.
These symptoms can mean the antibiotic isn't working against the bacteria or that the infection has worsened.
No, a urinary tract infection (UTI) should always be treated with antibiotics while pregnant. Bacteria in the urine that go untreated can progress to a kidney infection — which is much more serious and may require hospitalization. Fluids, cranberry products, and over-the-counter (OTC) remedies won't clear a UTI, but you may be able to use them along with your antibiotics.
There aren’t adequate studies on the safety of antibiotic ointments in pregnant women.
Generally speaking, antibiotic ointments aren’t absorbed into the bloodstream like those taken by mouth, so they likely carry far less risk in pregnancy. That being said, antibiotic ointments like mupirocin (Bactroban) are only advised by healthcare professionals when absolutely needed. Talk to a healthcare professional before using any antibiotics in pregnancy.
One thing to know: An ointment won't do anything for a UTI. Skin antibiotics don't reach the urinary tract, so a UTI still needs an oral antibiotic.
Antibiotics can begin to work within hours, but most people don’t start feeling better until a day or two after the first dose. But it’s important to finish the full course anyway — even once symptoms fade — to keep the infection from coming back. Call your prescriber in these cases:
You're not improving after 2 to 3 days.
You develop a fever, chills, back pain, or nausea.
These symptoms can mean the antibiotic isn't working against the bacteria or that the infection has worsened.
The bottom line
Urinary tract infections (UTIs) are very common during pregnancy. Without treatment, UTIs can lead to serious health problems, like kidney infections and premature birth. But there are safe and effective antibiotics that can cure UTIs during pregnancy.
Cephalexin is usually one of the first-choice UTI antibiotics. Other antibiotics might be used, depending on certain circumstances. Some, like ciprofloxacin, are avoided whenever possible. No matter what you’re prescribed, remember to finish your complete course of antibiotics, even if your symptoms start to improve.
Why trust our experts?


References
American College of Obstetricians and Gynecologists. (2023). Urinary tract infections in pregnant individuals.
American Pregnancy Association. (2026). Urinary tract infection – UTI during pregnancy.
GlaxoSmithKline. (2014). Bactroban ointment .
Habak, P. J., et al. (2026). Urinary tract infection in pregnancy. StatPearls.
Lee, M., et al. (2008). Urinary tract infections in pregnancy. Canadian Family Physician (Medecin de famille canadien).
Matuszkiewicz-Rowińska, J., et al. (2015). Urinary tract infections in pregnancy: old and new unresolved diagnostic and therapeutic problems. Archives of Medical Science.














