BackgroundVitamin D deficiency and insufficiency represent critical public health concerns on a global scale. Due to the increase in indoor activities, the role of dietary intake of vitamin D has become increasingly prominent. However, previous studies have focused solely on a single food item.ObjectivesThis study aimed to identify dietary patterns among school-aged children in rural areas of Guangzhou, China, and to explore their association with vitamin D levels.MethodsA total of 2,346 children aged 6–17 years were included in this cross-sectional study. Demographic, lifestyle, and dietary data were collected through structured questionnaires. Dietary patterns were identified using factor analysis, while linear regression and structural equation modeling were employed to analyze the relationship between these patterns and vitamin D levels.ResultsThree distinct dietary patterns emerged: a fruits and vegetables pattern, high-protein pattern, and snack pattern. Analysis revealed that a higher adherence to the fruits and vegetables dietary pattern was associated with lower vitamin D levels. Conversely, among girls, a stronger preference for the high-protein dietary pattern was positively correlated with higher vitamin D levels.ConclusionThe fruits and vegetables pattern emerged as a risk factor for inadequate internal vitamin D levels. In girls, the high-protein pattern functioned as a protective factor. These findings offer valuable insights and policy recommendations for enhancing the health status of children in rural communities.