BackgroundDuring the past decades, social inequality in mortality has increased in several countries, including Denmark. Modifiable risk factors, such as smoking and harmful alcohol consumption, have been suggested to moderate the association between socioeconomic position and health-related outcomes. The present study aims to investigate the contribution of smoking- and alcohol-related deaths to the trends in educational inequality in mortality in Denmark 1995–2019 among individuals aged 30–74 years.MethodsNationwide data on mortality and highest attained educational level divided into quartiles were derived from administrative registers. Alcohol-related mortality was directly estimated using information on alcohol-related deaths from death certificates. Smoking-related mortality was indirectly estimated using the Peto-Lopez method. The contribution of smoking- and alcohol-related deaths to the social inequality gap in mortality 1995–2019 was calculated.ResultsAlongside a decrease in all-cause mortality in Denmark 1995–2019, absolute differences in the mortality rate (per 100 000 person-year) between the lowest and the highest educational quartile increased from 494 to 607 among men and from 268 to 376 among women. Among both men and women, smoking- and alcohol-related deaths explained around 60% of the social inequality in mortality and around 50% of the increase in mortality inequality.ConclusionSmoking and harmful alcohol consumption continue to be important risk factors and causes of social inequality in mortality, with around half of the increase in Denmark 1995–2019 being attributable to smoking- and alcohol-related deaths. Future healthcare planning and policy development should aim at reducing social inequality in modifiable health risk behaviours and their negative consequences.