The objective of the study was to assess whether gestational and early infancy exposure to low dose vitamin D from a mandatory margarine fortification programme in Denmark influenced the risk of developing type 1 diabetes (T1D) before age of 15 years. The study population included all individuals born in Denmark from 1983 to 1988 and consisted of 331,623 individuals. The 1st of June 1985, which was the date of issue of the new ministerial order cancelling mandatory fortification of margarine with vitamin D in Denmark, served as a reference point separating the studied population into various exposure groups. We further modelled birth cohort effects in children developing T1D as a linear spline, and compared the slopes between the birth cohorts with various prenatal and infancy exposures to vitamin D fortification. In total, 886 (0.26%) individuals developed T1D before the age of 15 years. The beta coefficients (95% CI), or slopes, for linear birth cohort effect in log Hazard Ratio (HR) per one month of birth in individuals born during the periods of gestational exposure, wash-out, and non-exposure were: 0.010 (-0.002/0.021), -0.010 (-0.035/0.018), and 0.008 (- 0.017/0.032), respectively. The beta coefficients (95% CI) for individuals born during the periods of first postnatal year exposure, wash-out, and non-exposure were: 0.007 (-0.016/0.030), 0.006 (-0.004/0.016), and 0.007 (-0.002/0.016), respectively. In conclusion, we found no evidence to support that exposure to low dose vitamin D from the Danish mandatory margarine fortification regimen during gestational and first postnatal year of life changed the risk of developing T1D before the age of 15 years.