Many children in the Netherlands do not adhere to dietary guidelines. Therefore, the Healthy School (HS) program stimulates healthier dietary intake of students through schools. However, evaluating the effectiveness of school health promotion in improving dietary intake is challenging due to the influence of contextual factors. Qualitative Comparative Analysis (QCA) considers these contextual factors. Therefore, we performed a QCA to examine which (combinations of) contextual factors contribute to the healthier dietary intake of students during school hours in primary schools (approximate age range children 4-12 years) and secondary schools (age range 12-18 years) when implementing the HS program for nutrition. Data were collected mainly through interviewing school staff and a school-level questionnaire in fifteen primary schools and twelve secondary schools. We included five factors for primary schools: implementation of the HS program for nutrition, degree of implementation, socioeconomic status, parental support, and student support. For secondary schools, we included school environment instead of parental and student support. For primary schools, the best results were obtained if the HS program for nutrition was implemented in high socioeconomic status schools with a combination of high implementation, parental support, and student support. Findings indicate that if secondary schools have an impeding environment and low socioeconomic status, implementation of the HS program for nutrition can result in healthier dietary intake.