This study aimed to explore the relationship between the lymphocyte/monocyte ratio (LMR) and erectile dysfunction (ED) in adult men in the United States using a comprehensive dataset. A cross-sectional study design was used to analyze the relationship between the lymphocyte-to-monocyte ratio (LMR) and the prevalence of erectile dysfunction (ED) among adult male participants in the NHANES 2001-2004 dataset. Statistical analyses were performed to adjust for potential confounders and explore non-linear associations, with LMR categorized into quartiles to investigate the relationship with ED prevalence. There was an L-shaped relationship between LMR and ED. The odds of ED decreased as LMR levels increased, but beyond a value of 3.50, the protective effect plateaued. Specifically, the odds of ED significantly decreased for LMR values ≤ 3.50 (OR = 0.67, 95% CI: 0.49-0.90, p = 0.009). Beyond an LMR of 3.50, there was no significant further reduction in the odds of ED, indicating a diminishing protective effect past this threshold. There is a distinctly L-shaped and negative correlation between LMR and ED in the NHANES dataset from 2001 to 2004.