Skip to content

Bactrim and Photosensitivity: Side Effects & Sun Protection

Does bactrim photosensitivity cause photosensitivity? Learn about this side effect and how to protect yourself from sun and light reactions.

For informational purposes only. This site exists to help people with light sensitivity live more comfortably — it does not provide medical advice, diagnoses, or treatment recommendations. Always consult your doctor or a qualified healthcare provider before making any health decisions. Read our full disclaimer →

Key Takeaways
  • Bactrim (TMP-SMX) photosensitivity is driven by its sulfonamide component — both phototoxic and photoallergic reactions have been documented.
  • Bactrim photosensitivity risk is higher in HIV+ and immunocompromised patients due to altered drug metabolism and immune dysregulation.
  • Sun protection is essential throughout Bactrim treatment: SPF 50+ mineral sunscreen on all exposed skin, UPF clothing, and avoiding peak UV hours.
  • Bactrim-induced photosensitivity typically resolves within 1–2 weeks of stopping the medication.
  • If a Bactrim-like antibiotic is needed after photosensitivity, dapsone (for PCP prophylaxis) or alternative antibiotics may be considered with prescriber guidance.

Bactrim (trimethoprim-sulfamethoxazole, TMP-SMX) is a combination antibiotic used for urinary tract infections, Pneumocystis pneumonia (PCP) prophylaxis in immunocompromised patients, and certain skin/soft tissue infections. The sulfonamide component (sulfamethoxazole) is responsible for Bactrim’s drug-induced photosensitivity — sulfonamides are a well-established class of photosensitizers.

Why Bactrim Causes Photosensitivity

Sunburned forearms showing Bactrim sulfonamide phototoxic reaction with erythema confined to UV-exposed skin below shirt sleeve line
Bactrim's sulfonamide component acts as a UV chromophore, causing phototoxic reactions in sun-exposed skin — easily preventable with SPF 50+ mineral sunscreen.

Sulfamethoxazole contains a sulfonamide group (–SO₂NH₂) that acts as a chromophore, absorbing UV radiation and generating reactive oxygen species through a phototoxic mechanism. Additionally, some patients develop photoallergic reactions — immune-mediated delayed hypersensitivity reactions to UV-activated sulfonamide metabolites.

Phototoxic reaction (more common):

  • Dose-dependent; occurs in any patient with adequate UV exposure
  • Onset within hours of sun exposure
  • Exaggerated sunburn-like reaction in sun-exposed areas

Photoallergic reaction (less common):

  • Requires prior sensitization to sulfonamide metabolites
  • Delayed onset (24–72 hours after UV exposure)
  • Eczematous, pruritic rash
  • Can spread beyond sun-exposed areas
  • May cross-react with other sulfonamide-containing drugs (furosemide, HCTZ, celecoxib, some sulfonylureas)

Clinical Presentation

Bactrim photosensitivity appears as:

  • Erythema (redness), edema, and burning in sun-exposed skin
  • Sharp clothing-line demarcation (phototoxic type)
  • Itchy eczematous rash that may spread (photoallergic type)
  • Facial erythema including periorbital area (may cause discomfort but not true ocular photophobia)
  • Rarely: severe bullous (blistering) reaction

Bactrim and Stevens-Johnson Syndrome (SJS): TMP-SMX is one of the drugs most commonly associated with SJS/toxic epidermal necrolysis — severe, potentially fatal mucocutaneous reactions. SJS is distinct from photosensitivity but involves mucous membranes (including eyes) and requires emergency medical attention. Any rash with mucosal involvement (mouth, eyes, genitalia) while on Bactrim requires immediate medical evaluation.

Sulfonamide Cross-Reactivity

Patients who develop photoallergic reactions to Bactrim may react to other sulfonamide-containing medications:

  • Diuretics: furosemide, hydrochlorothiazide, indapamide
  • Diabetes drugs: glyburide, glipizide, glimepiride (sulfonylureas)
  • Pain medications: celecoxib (COX-2 inhibitor)
  • Topical: sulfacetamide eye drops, silver sulfadiazine

Inform all treating physicians and pharmacists of a sulfonamide photosensitivity/allergy history.

Prevention and Management

During Bactrim therapy:

  • Apply broad-spectrum SPF 30–50+ sunscreen to all exposed skin before going outdoors
  • Wear protective clothing and hat
  • Minimize peak-hour sun exposure (10am–4pm)
  • Bactrim courses are often short (3–10 days for UTI); sustained protection is practical

If a reaction occurs:

  • Cool compresses, topical corticosteroids for phototoxic reactions
  • Oral antihistamines for pruritus (photoallergic type)
  • Discontinue Bactrim and contact prescriber
  • Seek emergency care immediately if mucous membrane involvement (mouth, eyes, genitalia) — possible SJS

Alternative antibiotics for UTI (with lower photosensitivity risk):

  • Nitrofurantoin (Macrobid)
  • Fosfomycin
  • Discuss with prescriber based on local antibiotic resistance patterns

Sources

  1. Shear NH, et al. “Differences in metabolism of sulfonamides predisposing to idiosyncratic toxicity.” Ann Intern Med. 1986;105(2):179-184.
  2. Knowles SR, et al. “Sulfonamide hypersensitivity reactions.” Drug Saf. 2001;24(3):239-251.
  3. Moore DE. “Drug-induced cutaneous photosensitivity.” Drug Saf. 2002;25(5):345-372.
Last updated: May 22, 2025 Medically reviewed by Dr. Sarah Mitchell, OD