Childhood risky behaviors always result in adverse health outcomes. These behaviors are greatly affected by social environment and individual factors. However, few studies explored the social determinants of schoolchildren's health behaviors. In this cross-sectional study, the social determinants of health behaviors were examined among both migrant and resident students in Beijing, China. Data of 967 children from six urban and suburban primary schools were analyzed using multiple linear regression analysis. The results showed that less than 60% of children performed some healthy behaviors, although their health knowledge was generally good. Children's health behavior scores were greatly determined by school characteristics, health knowledge, demographic characteristics, and family context. Therefore, improving health education and conditions in primary schools is the priority to promote children's healthy behaviors, especially for disadvantaged children.