When should cotrimoxazole (trimethoprim‑sulfamethoxazole) be used?

Medical Advisory BoardAll articles are reviewed for accuracy by our Medical Advisory Board
Educational purpose only • Exercise caution as content is pending human review
Article Review Status
Submitted
Under Review
Approved

Last updated: March 4, 2026View editorial policy

Personalize

Help us tailor your experience

Which best describes you? Your choice helps us use language that's most understandable for you.

When to Use Cotrimoxazole (Trimethoprim-Sulfamethoxazole)

Cotrimoxazole should be used primarily for Pneumocystis jirovecii pneumonia (PCP) prophylaxis in HIV-infected patients with CD4 counts <200 cells/µL, for treatment of documented PCP, and for specific infections including toxoplasmosis, nocardiosis, and Stenotrophomonas maltophilia. 1, 2

Primary Indications for Cotrimoxazole Use

HIV-Related Opportunistic Infection Prophylaxis

  • Initiate cotrimoxazole when CD4 count falls below 200 cells/µL in all HIV-infected adults and adolescents, including pregnant women, regardless of antiretroviral therapy status. 1
  • Start prophylaxis immediately if the patient has oropharyngeal candidiasis or unexplained fever >100°F for ≥2 weeks, even when CD4 count is above 200 cells/µL. 1
  • **Consider prophylaxis when CD4 percentage is <14%** or when there is a history of an AIDS-defining illness, even if absolute CD4 count is >200 cells/µL. 1

Preferred dosing: One double-strength tablet (160 mg TMP/800 mg SMX) once daily provides simultaneous protection against PCP, toxoplasmosis (in seropositive patients), and common bacterial respiratory infections. 1

Toxoplasmosis Prophylaxis and Treatment

  • For Toxoplasma-IgG-positive patients with CD4 <100 cells/µL, the same daily double-strength cotrimoxazole tablet used for PCP prophylaxis provides adequate toxoplasmosis coverage—no additional agent is needed. 3, 4
  • For acute toxoplasma encephalitis treatment, use 5 mg/kg trimethoprim plus 25 mg/kg sulfamethoxazole IV or orally twice daily for 6 weeks, assuming clinical and radiological improvement. 3
  • For congenital toxoplasmosis, treatment duration is 12 months according to the American Academy of Pediatrics. 3

FDA-Approved Therapeutic Indications

  • Documented Pneumocystis carinii pneumonia treatment in immunosuppressed patients. 2
  • Urinary tract infections caused by susceptible E. coli, Klebsiella, Enterobacter, Morganella morganii, Proteus mirabilis, and Proteus vulgaris. 2
  • Acute otitis media in pediatric patients (≥2 months old) due to susceptible Streptococcus pneumoniae or Haemophilus influenzae when cotrimoxazole offers advantages over single agents. 2
  • Acute exacerbations of chronic bronchitis caused by susceptible S. pneumoniae or H. influenzae. 2
  • Shigellosis (Shigella flexneri and Shigella sonnei) when antibacterial therapy is indicated. 2
  • Travelers' diarrhea due to enterotoxigenic E. coli in adults. 2

Unconventional but Evidence-Supported Uses

  • Stenotrophomonas maltophilia infections, where cotrimoxazole remains the drug of choice. 5
  • Nocardiosis, brucellosis, and chancroid, where cotrimoxazole has demonstrated superiority over trimethoprim alone. 6
  • Invasive methicillin-resistant Staphylococcus aureus (MRSA) infections, supported by retrospective and prospective studies showing good clinical outcomes. 5
  • Listeria monocytogenes, Burkholderia, Coxiella burnetii, and Tropheryma whipplei infections. 5

When NOT to Use Cotrimoxazole

Absolute Contraindications

  • Infants <2 months of age due to risk of kernicterus. 2
  • Pregnant women at term and nursing mothers with infants <2 months old, as sulfonamides displace bilirubin from plasma proteins, causing hyperbilirubinemia and kernicterus risk. 7, 2
  • Patients with documented hypersensitivity to trimethoprim or sulfonamides. 2
  • Patients with megaloblastic anemia due to folate deficiency. 2

Relative Contraindications and High-Risk Situations

  • Glucose-6-phosphate dehydrogenase (G6PD) deficiency, where hemolysis may occur (frequently dose-related). 2
  • Severe renal insufficiency (CrCl <15 mL/min) without dose adjustment, as both components accumulate and increase toxicity risk. 2
  • Severe hepatic impairment, which increases risk of adverse effects. 2
  • Elderly patients on thiazide diuretics, who have increased risk of thrombocytopenia with purpura. 2
  • Patients with underlying potassium metabolism disorders or on ACE inhibitors, due to risk of life-threatening hyperkalemia from the trimethoprim component. 2

Critical Monitoring Requirements

  • Perform complete blood counts at least weekly during treatment to detect bone marrow suppression, particularly in elderly patients and those with preexisting folate deficiency. 3, 2
  • Monitor serum potassium closely in patients with renal insufficiency, those receiving ACE inhibitors, or those with underlying potassium metabolism disorders. 2
  • Ensure adequate fluid intake to prevent crystalluria and stone formation, especially with high-dose therapy. 2
  • Monitor for skin rash, fever, leukopenia, and elevated aminotransferases, which occur more frequently in AIDS patients (up to 50-80% incidence) compared to non-AIDS patients. 2

When to Discontinue Prophylaxis

  • Stop PCP and toxoplasmosis prophylaxis when CD4 count rises above 200 cells/µL and remains elevated for ≥3 months on effective antiretroviral therapy with virologic suppression. 1, 4
  • Restart prophylaxis immediately if CD4 count falls below the original threshold (<200 cells/µL for PCP/toxoplasmosis). 4
  • Do not base discontinuation on a single CD4 measurement; sustained elevation for ≥3 months is mandatory. 4

Important Clinical Pitfalls to Avoid

  • Do not use cotrimoxazole for uncomplicated cystitis in regions where E. coli resistance exceeds 10-20%; fluoroquinolones are preferred in these settings. 8
  • Do not use cotrimoxazole routinely for infections where trimethoprim alone is equally effective (most urinary and respiratory tract infections), as this exposes patients to unnecessary sulfonamide-related adverse effects without added benefit. 6, 9
  • Do not prescribe cotrimoxazole to HIV-exposed but uninfected infants, as recent evidence shows no benefit and potential harm from antimicrobial resistance and microbiome disruption. 1
  • Avoid excessive dosing in patients with normal renal function, as guideline-recommended doses (90 mg/kg/day for PCP treatment) may cause supratherapeutic exposure and toxicity. 10
  • Never delay discontinuation of cotrimoxazole if severe rash, Stevens-Johnson syndrome, or significant cytopenias develop, as these can be life-threatening. 2, 9
  • Do not use aerosolized pentamidine as sole prophylaxis when CD4 <100 cells/µL in Toxoplasma-seropositive patients, as it provides no toxoplasmosis coverage. 4

Special Populations

AIDS Patients

  • AIDS patients have a markedly increased incidence of adverse effects (rash, fever, leukopenia, elevated transaminases) compared to non-AIDS patients, but these are generally less severe with prophylactic versus therapeutic dosing. 2
  • A history of mild intolerance does not predict intolerance of subsequent prophylaxis, so rechallenge may be considered after resolution of adverse events. 2

Elderly Patients

  • Use the lowest effective dose and shortest duration possible in elderly patients due to increased risk of severe adverse reactions, particularly thrombocytopenia, bone marrow suppression, and hyperkalemia. 2
  • Monitor digoxin levels closely, as cotrimoxazole increases digoxin blood levels, especially in elderly patients. 2

Renal Impairment

  • For CrCl <15 mL/min, reduce dose to 50 mg/kg/day divided three times daily for PCP treatment based on pharmacokinetic modeling. 10
  • Avoid cotrimoxazole in severe renal dysfunction without dose adjustment, as accumulation of both components significantly increases toxicity risk, including crystalline nephropathy. 11

References

Guideline

Guideline Directed Topic Overview

Dr.Oracle Medical Advisory Board & Editors, 2025

Guideline

Treatment Duration for Toxoplasmosis

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2026

Guideline

Prophylactic Antimicrobial Regimens and Immediate ART for Adults with Advanced HIV (CD4 < 50 cells/µL)

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2026

Research

Contemporary unconventional clinical use of co-trimoxazole.

Clinical microbiology and infection : the official publication of the European Society of Clinical Microbiology and Infectious Diseases, 2012

Research

Limitations of and indications for the use of co-trimoxazole.

Journal of chemotherapy (Florence, Italy), 1994

Guideline

Safety of Bactrim During Lactation

Praxis Medical Insights: Practical Summaries of Clinical Guidelines, 2025

Professional Medical Disclaimer

This information is intended for healthcare professionals. Any medical decision-making should rely on clinical judgment and independently verified information. The content provided herein does not replace professional discretion and should be considered supplementary to established clinical guidelines. Healthcare providers should verify all information against primary literature and current practice standards before application in patient care. Dr.Oracle assumes no liability for clinical decisions based on this content.

Have a follow-up question?

Our Medical A.I. is used by practicing medical doctors at top research institutions around the world. Ask any follow up question and get world-class guideline-backed answers instantly.