How Cotrimoxazole Works and What It Treats

Cotrimoxazole is a combination antibiotic made of two drugs, sulfamethoxazole and trimethoprim, that work together to block bacteria from making folic acid, a nutrient they need to grow and reproduce. Sold under brand names like Bactrim and Septra, it has been one of the most widely prescribed antibiotics in the world since the 1970s. Its usefulness stretches from routine urinary tract infections to life-threatening opportunistic infections in people with HIV, though rising resistance and a particular profile of serious side effects mean it is not the simple workhorse it once seemed.

How the Two Components Work Together

Bacteria need to build their own folic acid from scratch, unlike humans, who get it from food. Cotrimoxazole exploits this difference by hitting the folic acid production line at two separate steps. Sulfamethoxazole blocks an early enzyme in the pathway, while trimethoprim blocks a later one. Each drug on its own slows bacterial growth; together, they are far more potent than either component alone.

This double hit is genuinely synergistic, not just additive. Research in E. coli and Staphylococcus aureus has shown that trimethoprim’s inhibition of tetrahydrofolate production also starves bacteria of a precursor they need for another metabolic pathway, amplifying the damage sulfamethoxazole causes upstream.1PubMed Central. Mutual potentiation drives synergy between trimethoprim and sulfamethoxazole The standard formulation combines the two drugs at a fixed ratio of one part trimethoprim to five parts sulfamethoxazole. Pharmacodynamic modeling has confirmed that this ratio range delivers strong synergy, though the optimal ratio can shift depending on the bacterial species involved.2Wiley Online Library. Quantitative Pharmacodynamic Analysis of Trimethoprim-Sulfonamide Combination Activity Against Staphylococcus pseudintermedius

Because the target is bacterial folic acid synthesis and human cells do not perform this synthesis, cotrimoxazole is reasonably selective. That said, trimethoprim does weakly inhibit the human version of dihydrofolate reductase, which is why high doses or prolonged courses can sometimes cause folate-related side effects in people, a point that matters for long-term prophylaxis.

Infections It Treats

Cotrimoxazole covers a surprisingly broad list of bacteria and even some parasites. Its classical uses include urinary tract infections, respiratory infections, bacterial diarrhea (including typhoid and shigellosis), and skin infections. The drug penetrates well into many tissues, including the prostate, lungs, and cerebrospinal fluid, giving it reach that many oral antibiotics lack.

Its role in treating Pneumocystis jirovecii pneumonia (PCP) in immunocompromised patients is arguably its most important modern application. PCP is a fungal lung infection that can be deadly in people with advanced HIV or those on immunosuppressive therapy. Cotrimoxazole remains the recommended first-line treatment and is also the standard drug for PCP prevention in people whose immune systems are severely weakened.3PubMed Central. Management of Pneumocystis Jirovecii pneumonia in HIV infected patients: current options, challenges and future directions This prophylactic use, given daily at a lower dose, has saved countless lives in sub-Saharan Africa and other regions with high HIV prevalence.

Cotrimoxazole is also effective against certain parasitic infections that most antibiotics cannot touch. It is the treatment of choice for Cyclospora and Isospora, two intestinal parasites that cause prolonged watery diarrhea, especially in travelers and immunocompromised people.4JAMA Internal Medicine. Trimethoprim-Sulfamethoxazole Revisited In a randomized trial among expatriates in Nepal, a seven-day course cleared Cyclospora from about 94% of treated patients, compared with just 12% on placebo.5PubMed. Placebo-controlled trial of co-trimoxazole for Cyclospora infections among travellers and foreign residents in Nepal It has some activity against Plasmodium falciparum malaria as well, and against cerebral toxoplasmosis, though better drugs exist for both.6PubMed. Contemporary unconventional clinical use of co-trimoxazole

Skin Abscesses and MRSA

Cotrimoxazole has experienced something of a revival in dermatology and emergency medicine because of community-acquired MRSA, the antibiotic-resistant staph strain that causes painful skin abscesses. MRSA is notoriously resistant to the penicillin-family drugs most doctors reach for first, but it often remains susceptible to cotrimoxazole.

A large randomized trial published in the New England Journal of Medicine tested whether adding cotrimoxazole to standard incision and drainage improved outcomes for skin abscesses. Among participants in the per-protocol group, about 93% of those who received the antibiotic were cured, compared with roughly 86% who received placebo. The antibiotic group also had fewer repeat drainage procedures, fewer new skin infections at other sites, and fewer infections spreading to household members.7PubMed Central. Trimethoprim-Sulfamethoxazole versus Placebo for Uncomplicated Skin Abscess Roughly 45% of participants in that trial had MRSA-positive cultures, reflecting how common the organism has become in community skin infections.

A practical question clinicians have asked is whether doubling the dose improves results. A study comparing the standard dose (one double-strength tablet twice daily) to twice that amount found no difference in cure rates for MRSA skin infections, suggesting the standard dose is sufficient for most patients.8PubMed Central. Dose of trimethoprim-sulfamethoxazole to treat skin and skin structure infections caused by methicillin-resistant Staphylococcus aureus

Urinary Tract Infections and the Resistance Problem

Cotrimoxazole was once a go-to drug for uncomplicated urinary tract infections, and in many guidelines it still holds that position, but only when local resistance rates are low enough to justify it. Here the picture varies enormously by geography and setting. A study in Jakarta, for example, found that bacteria from community-acquired UTIs were susceptible to cotrimoxazole about 83% of the time, while those from hospital-acquired UTIs were susceptible only 44% of the time.9Medical Journal of Indonesia. Bacterial susceptibility patterns to cotrimoxazole in urinary tract infections of outpatients and inpatients in Jakarta, Indonesia In some parts of the world, the numbers are far worse. One study of E. coli urinary isolates found cotrimoxazole resistance in 95% of strains, making it essentially useless as empiric therapy in that population.10Journal of the National Medical Association. Antimicrobial Resistance in Escherichia coli Strains From Urinary Tract Infections

The general pattern is that resistance is higher in hospitals, in countries with over-the-counter antibiotic sales, and in populations that have had repeated antibiotic exposure. If you are prescribed cotrimoxazole for a UTI, the doctor is usually making a judgment call based on local susceptibility data. In regions where resistance remains under about 20%, it is still a reasonable first-line choice; above that threshold, guidelines generally recommend alternatives like nitrofurantoin.

How Resistance Develops

Resistance to cotrimoxazole is driven by acquired genes that produce altered versions of the enzymes each component targets. Bacteria pick up these resistance genes on mobile genetic elements, which are stretches of DNA that hop between organisms, allowing resistance to spread quickly through bacterial communities. Researchers have now catalogued four genes conferring sulfonamide resistance and several dozen conferring trimethoprim resistance.11PubMed Central. Genetics of resistance to trimethoprim in cotrimoxazole resistant uropathogenic Escherichia coli: integrons, transposons, and single gene cassettes These genes are frequently carried on integrons, structures that collect and shuffle resistance cassettes like a deck of cards, sometimes bundling cotrimoxazole resistance together with resistance to other drugs like aminoglycosides.12PubMed. Integrons and gene cassettes in clinical isolates of co-trimoxazole-resistant Gram-negative bacteria

This multi-drug resistance bundling is one reason cotrimoxazole resistance matters beyond just cotrimoxazole. A bacterium that picks up a cassette containing trimethoprim resistance may simultaneously acquire resistance to streptomycin and spectinomycin. The use of cotrimoxazole in livestock feed, even at very low concentrations, has drawn regulatory scrutiny for the same reason: trace amounts can potentially select for resistant bacteria that could later reach humans.13PubMed Central. Maximum levels of cross‐contamination for 24 antimicrobial active substances in non‐target feed. Part 13: Diaminopyrimidines: trimethoprim

Serious Skin Reactions

The side effect that worries doctors most with cotrimoxazole is Stevens-Johnson syndrome (SJS) and its more severe form, toxic epidermal necrolysis (TEN). These are rare but potentially fatal conditions in which the skin blisters and peels off in sheets. A large pharmacovigilance study analyzing real-world adverse event reports found that sulfamethoxazole carried the highest risk signal for SJS/TEN among all antibiotics evaluated.14PubMed. Association of antibiotics with Stevens-Johnson syndrome and toxic epidermal necrolysis: A real-world pharmacovigilance study

The risk is not evenly distributed. A systematic review and meta-analysis identified specific immune-system gene variants (HLA types) that substantially increase susceptibility. People carrying HLA-B*13:01, for instance, had roughly five times the odds of developing a severe cutaneous reaction to cotrimoxazole compared with controls. Several other HLA variants, including B*38:02, B*07:05, and C*07:27, were also linked to significantly elevated risk.15JAMA Dermatology. Human Leukocyte Antigens and Sulfamethoxazole/Cotrimoxazole–Induced Severe Cutaneous Adverse Reactions: A Systematic Review and Meta-Analysis These HLA types vary in frequency across ethnic groups, which helps explain why SJS/TEN from cotrimoxazole is reported more often in certain populations. Pre-prescription genetic screening is not yet routine, but it is an active area of research, similar to the way HLA-B*57:01 testing is now standard before prescribing the HIV drug abacavir.

People with HIV appear to be at higher risk for cotrimoxazole-related skin reactions even independent of HLA type, and the reactions tend to be more severe. Case reports of SJS have been documented in both HIV-positive and HIV-negative patients, with supportive care (including wound management and sometimes corticosteroids) forming the mainstay of treatment.16PubMed Central. Cotrimoxazole Induced Steven Johnson Syndrome: A Case Report

Blood Cell Effects and Folate

Because trimethoprim interferes with folate metabolism, long-term or high-dose use can suppress blood cell production. The most common manifestation is a drop in red blood cells, white blood cells, or platelets, usually mild and reversible. These effects are dose-dependent and show up more often in people who are already folate-deficient, elderly, or taking other drugs that affect folate.17PubMed. Hematological side effects of co-trimoxazole Folate supplementation can prevent or treat these side effects in most cases, though there has been debate over whether supplementing with folic acid might blunt the antibiotic effect. A hospital pharmacy investigation found that folate supplementation could theoretically reduce efficacy, particularly when doses are generous, so clinicians sometimes weigh the tradeoff carefully in patients on prolonged courses.18European Journal of Hospital Pharmacy. Cotrimoxazole: how folate supplementation could affect treatment efficacy

In rare cases, cotrimoxazole can cause pancytopenia, a simultaneous drop in all three major blood cell types. This has been reported in elderly patients and those with impaired kidney function, sometimes after only two weeks of treatment.19PubMed Central. Trimethoprim-sulfamethoxazole Induced Pancytopenia: A Common Occurrence but A Rare Diagnosis Routine blood count monitoring is generally recommended for anyone taking the drug for more than a couple of weeks.

Potassium and Kidney Concerns

A less well-known side effect of trimethoprim is that it raises blood potassium levels. Trimethoprim blocks sodium channels in the kidney’s distal tubule in a way that is nearly identical to amiloride, a potassium-sparing diuretic.20PubMed. Trimethoprim-induced hyperkalaemia: clinical data, mechanism, prevention and management In a young, healthy person taking a standard short course, the potassium bump is usually trivial. But in older adults, people with chronic kidney disease, or anyone already taking drugs that raise potassium (ACE inhibitors, angiotensin receptor blockers, potassium supplements), cotrimoxazole can push potassium into a dangerously high range. This interaction has been linked to sudden cardiac deaths in population-level studies, making it one of the most practically important drug safety issues with cotrimoxazole.

Drug Interactions Worth Knowing

Cotrimoxazole interacts meaningfully with several commonly prescribed drugs. Two stand out:

  • Warfarin: Cotrimoxazole inhibits the liver enzyme that breaks down the more active form of warfarin, raising warfarin levels in the blood. Population-based studies have found that taking cotrimoxazole while on warfarin roughly doubles or triples the risk of gastrointestinal bleeding compared with other antibiotics.21CMAJ. Considerations when prescribing trimethoprim–sulfamethoxazole
  • Methotrexate: In people taking methotrexate for autoimmune conditions or cancer, cotrimoxazole reduces the kidney’s ability to clear methotrexate by about 40%, while also amplifying its folate-blocking effects. The combination is formally recommended against by rheumatology guidelines.22CMAJ. Considerations when prescribing trimethoprim–sulfamethoxazole

If you are prescribed cotrimoxazole while taking either of these drugs, your doctor will likely choose a different antibiotic or closely monitor you with extra blood tests.

Cotrimoxazole in Pregnancy

Cotrimoxazole use during pregnancy generates caution because of its anti-folate mechanism. Folate is critical for fetal neural tube development, especially in the first trimester. Most guidelines advise avoiding cotrimoxazole during early pregnancy when alternatives are available. However, in settings where HIV-positive pregnant women rely on cotrimoxazole prophylaxis to prevent opportunistic infections, the calculus changes. A systematic review and meta-analysis of cotrimoxazole safety in pregnancy found reassuringly low rates of neonatal jaundice and no reported cases of kernicterus.23PubMed Central. Safety of cotrimoxazole in pregnancy: a systematic review and meta-analysis The overall picture from the available studies suggests that when cotrimoxazole is genuinely needed during pregnancy, the benefits for preventing serious maternal infections generally outweigh the theoretical folate-related risks, especially when adequate folate supplementation is provided.

Prophylaxis in Children Without HIV

Given cotrimoxazole’s success in preventing infections in HIV-positive populations, researchers have tested whether it could reduce deaths in other vulnerable groups, particularly severely malnourished children in sub-Saharan Africa. The logic seemed sound: malnourished children have weakened immune systems and frequently die from bacterial infections. But a large, placebo-controlled trial in Kenya found no mortality benefit. About 14% of children receiving daily cotrimoxazole died, compared with about 15% on placebo, a difference that was not statistically meaningful.24PubMed Central. Daily co-trimoxazole prophylaxis to prevent mortality in children with complicated severe acute malnutrition: a multicentre, double-blind, randomised placebo-controlled trial This was a sobering result, and the investigators concluded that other strategies need to be tested for this population.

A separate trial examined whether cotrimoxazole prophylaxis benefited HIV-exposed but uninfected breastfed infants in South Africa. These are babies born to HIV-positive mothers who did not acquire the virus themselves but may still have some immune vulnerability. The study found that skipping cotrimoxazole was not inferior to giving it: infants who received no prophylaxis had roughly equal or slightly lower rates of severe pneumonia, diarrhea, and death compared with those who received cotrimoxazole.25The Lancet Global Health. Effect of co-trimoxazole on morbidity and mortality in breastfed HIV-exposed uninfected infants in South Africa (co-trimoxazole study): a randomised controlled, non-inferiority trial These findings are gradually reshaping guidelines for populations where cotrimoxazole prophylaxis had been extended more broadly.

Veterinary Use and Agricultural Resistance Pressure

Cotrimoxazole and its components are not restricted to human medicine. Trimethoprim-sulfonamide combinations are widely used in veterinary practice to treat bacterial infections in livestock, poultry, farmed fish, and companion animals. The European Food Safety Authority has evaluated the concentrations of trimethoprim in animal feed that might select for resistant bacteria, and their findings illustrate the challenge: even extremely low levels of unintentional contamination in feed can, in theory, promote resistance in the gut bacteria of farm animals.26PubMed Central. Maximum levels of cross‐contamination for 24 antimicrobial active substances in non‐target feed. Part 13: Diaminopyrimidines: trimethoprim The thresholds identified vary by species, from fractions of a microgram per kilogram of feed in poultry to somewhat higher levels in ruminants. Because the resistance genes for trimethoprim and sulfonamides travel on mobile genetic elements that readily cross species boundaries, agricultural use is considered a meaningful contributor to the global resistance pool, complicating efforts to preserve the drug’s usefulness in human medicine.

The Historical Arc of a Combination Drug

The development of cotrimoxazole grew out of early antimalarial research. Diaminopyrimidines, the chemical family that includes trimethoprim, were first tested as single agents in clinical trials. Researchers noticed that these compounds showed striking synergy with sulfonamides against malaria parasites, and the principle was later applied to bacterial infections. The combination of trimethoprim with sulfamethoxazole, introduced in the late 1960s, proved to be one of the most commercially successful antibiotic partnerships ever developed.27PubMed. History and future of antimicrobial diaminopyrimidines For decades it was prescribed so freely for ear infections, bronchitis, and UTIs that resistance was almost inevitable. The drug’s reputation has swung between periods of enthusiasm and neglect, and its current standing is best described as indispensable for specific indications but no longer suitable as a broad empiric choice the way it once was.