Purpose: Hormone replacement therapy (HRT) use increases breast cancer risk and mammographic density (MD). We examine whether MD mediates or modifies the association of HRT with the breast cancer. Methods: For the 4,501 participants in the Danish diet, cancer and health cohort (1993–1997) who attended mammographic screening in Copenhagen (1993–2001), MD (mixed/dense or fatty) was assessed at the first screening after cohort entry. HRT use was assessed by questionnaire and breast cancer diagnoses until 2012 obtained from the Danish cancer registry. The associations of HRT with MD and with breast cancer were analyzed separately using Cox’s regression. Mediation analyses were used to estimate proportion [with 95% confidence intervals (CI)] of an association between HRT and breast cancer mediated by MD. Results: 2,444 (54.3%) women had mixed/dense breasts, 229 (5.4%) developed breast cancer, and 35.9% were current HRT users at enrollment. Compared to never users, current HRT use was statistically significantly associated with having mixed/dense breasts (relative risk and 95% CI 1.24; 1.14–1.35), and higher risk of breast cancer (hazard ratio 1.87; 1.40–2.48). Association between current HRT use and breast cancer risk was partially mediated by MD (percent mediated = 10%; 95% CI 4–22%). The current HRT use-related breast cancer risk was higher in women with mixed/dense (1.94; 1.37–3.87) than fatty (1.37; 0.80–2.35) breasts (p value for interaction = 0.15). Conclusions: MD partially mediates some of the association between HRT and breast cancer risk. The association between HRT and breast cancer seems to be stronger in women with dense breasts.