Health Conditions A-Z Urological Conditions UTI How Do You Get a Urinary Tract Infection? UTIs happen if bacteria enter the urethra and cause painful, cloudy urine that may smell. By Joni Sweet Joni Sweet Joni Sweet's Instagram Joni Sweet's Twitter Joni Sweet's Website Joni Sweet is a freelance writer and editor who specializes in travel, health, and wellness. Her work has been published by Health, SELF, Healthline, National Geographic, Forbes, Lonely Planet, Thrillist, and dozens of other publications. When she’s not traveling the world, she can be found practicing yoga, riding her bike, and looking for the best vegetarian food in the Hudson Valley. health's editorial guidelines Updated on April 4, 2023 Medically reviewed by Cordelia Nwankwo, MD Medically reviewed by Cordelia Nwankwo, MD Cordelia Nwankwo, MD, is a board-certified gynecologist who has been in private practice for 8 years. learn more Share this page on Facebook Share this page on Twitter Share this page on Pinterest Email this page Urinary tract infections (UTIs) commonly occur if bacteria enter the urethra, the duct where urine leaves the body. Several factors, like sexual activity and kidney stones, increase UTI risk. Understanding how you might get a UTI and how it affects your body can help you deal with it. Here's what you should know about what causes a UTI and where the bacteria come from. Getty Images What Causes UTIs? UTIs happen when bacteria infect the urinary tract after entering the urethra. The bacteria may come from a person's skin or rectum. Escherichia coli (E. coli) is a bacterium that usually lives peacefully in your bowel but can lead to a UTI if it enters the urinary tract. Though E. coli causes many UTIs, infections can come from other bacteria (e.g., Streptococcus, Klebsiella, and Proteus mirabilis) and fungi. UTI treatments depend on the type of pathogen causing the infection. A healthcare provider can obtain and send a urine sample for testing to figure out what pathogen is the culprit. UTIs in Pregnancy Are Common, According to Doctors What Is an Upper UTI? A UTI could eventually lead to an upper UTI if untreated. You get an upper UTI if the bacteria travel up your ureters and invade your kidneys. An upper UTI can cause permanent kidney damage or even sepsis, a life-threatening infection. Typically, UTIs cause painful urination and cloudy or bloody urine. In addition to those symptoms, look out for upper UTI symptoms, such as: FeverChillsPain on your side, back, or groinVomitingNausea Who Gets UTIs? All people have urethras and bladders, making them vulnerable to bacterial infections. Still, certain factors increase the risk of UTIs, such as: Older ageAnything blocking the flood of urineBowel incontinenceHealth conditions affecting personal care habits, like Alzheimer's diseaseDiabetesHaving a urinary catheterKidney stonesMenopausePregnancyProblems emptying the bladderProcedures involving the urinary tractStaying still or being immobile UTIs and Biological Sex UTIs also tend to happen more often in females than males. The urethra in females is usually no more than about 1.5 inches long. In comparison, the urethra in males stretches between seven to eight inches long. In males, bacteria have to travel much farther to infect the bladder or other parts of the urinary tract. Urine can flush out bacteria before they can colonize. For females, the urethral opening is located between the labia in front of the vaginal opening, which is close to the anus. Since the male urethral opening is on the tip of the penis, it is less likely to come in contact with any bacteria from the anus. Common Causes of UTIs E. coli or other pathogens are the culprits of UTIs. A few behaviors impact a person's risk of UTIs and how the bacteria reach the urethra, from kidney stones to wet bathing suits. Sex Engaging in sexual activity can result in a UTI. A person could accidentally spread bacteria into their or their partner's urethra during sex. For example, using some birth control methods during sex—namely, spermicides and diaphragms—can increase the risk of UTIs. Diaphragms can slow the flow of your pee, while spermicides can irritate your skin. To reduce the likelihood of UTIs, urinate before and after sexual activity. Wiping From Back to Front In females, wiping back to front after urinating increases the risk of UTIs. Wiping that way can drag any bacteria in the anal region to the urethra. Therefore, wiping front to back can help prevent UTIs. Kidney Stones Kidney stones are hard deposits that can cause a UTI if they block your urinary tract. Blockage makes it difficult to fully release all your pee, creating a breeding ground for bacteria. Holding Your Pee Holding your pee can often create an environment for bacteria to thrive and infect your bladder. Urinating or trying to urinate if it's been three to four hours may lessen the risk of UTIs. Wet Bathing Suits Sitting in a wet bathing suit will not directly cause an infection. A wet bathing suit can cause a UTI by creating a bacteria-friendly environment. The same goes for damp underwear or sweaty gym clothes. Keep any clothing near the vagina or penis dry by changing wet clothing to avoid bacteria. Home Remedies for Preventing and Treating UTIs A Quick Review When bacteria enter a person's urethra, a UTI can occur. UTIs can go beyond the bladder and affect the kidneys if untreated. Anyone can develop UTIs. Factors like diabetes, immobility, and older age can increase UTI risk. Causes of UTIs include prolonged wear of wet clothing or wiping from back to front. Regardless of how you got a UTI, paying attention to it is essential. Consult a healthcare provider as soon as possible if you have symptoms of a UTI. Was this page helpful? Thanks for your feedback! Tell us why! Other Submit 11 Sources Health.com uses only high-quality sources, including peer-reviewed studies, to support the facts within our articles. Read our editorial process to learn more about how we fact-check and keep our content accurate, reliable, and trustworthy. Centers for Disease Control and Prevention. Urinary tract infection. Centers for Disease Control and Prevention. Questions and answers. Merck Manual Professional Version. Bacterial urinary tract infections. MedlinePlus. Urinary tract infection - adults. Bono MJ, Leslie SW, Reygaert WC. Urinary tract infection. In: StatPearls. StatPearls Publishing; 2023. National Institute of Diabetes and Digestive and Kidney Diseases. Symptoms & causes of kidney infection (pyelonephritis). Abelson B, Sun D, Que L, et al. Sex differences in lower urinary tract biology and physiology. Biol Sex Differ. 2018;9(1):45. doi:10.1186/s13293-018-0204-8 MedlinePlus. Vagina. Eunice Kennedy Shriver National Institute of Child Health and Human Development. What causes UTIs & UI?. Office on Women's Health. Urinary tract infections. MedlinePlus. Kidney stones.