Tamoxifen is a selective estrogen receptor (ER) modulator that is used to treat ER-positive breast cancer, but that at high doses kills both ER-positive and ER-negative breast cancer cells. We recapitulate this off-target effect in Caenorhabditis elegans, which does not have an ER ortholog. We find that different bacteria dramatically modulate tamoxifen toxicity in C. elegans, with a three-order of magnitude difference between animals fed Escherichia coli, Comamonas aquatica, and Bacillus subtilis. Remarkably, host fatty acid (FA) biosynthesis mitigates tamoxifen toxicity, and different bacteria provide the animal with different FAs, resulting in distinct FA profiles. Surprisingly these bacteria modulate tamoxifen toxicity by different death mechanisms, some of which are modulated by FA supplementation and others by antioxidants. Together, this work reveals a complex interplay between microbiota, FA metabolism and tamoxifen toxicity that may provide a blueprint for similar studies in more complex mammals.