Purpose: This study explored whether instructional characteristics, learner characteristics, family socioeconomic status, and gender influence creativity in the context of programming education in China.Methods: A total of 851 upper-secondary-school students in Beijing, China, were surveyed using the Creativity Scale, Programming Learning Scale, Programming Teaching Scale and Family Socioeconomic Status Questionnaire. SPSS (version 22) was used for correlation analysis, t-test and regression analysis.Results: (1) Teachers’ programming teaching method and management; students’ programming learning approach, attitude, and engagement; gender; and family economic capital were all significantly associated with creativity. (2) There were significant differences between males and females in terms of creativity, programming learning approach and programming learning attitude. (3) Learner attitudes, engagement, and approach, and their family economic capital, were strong predictors of creativity, with the strongest influence of learners’ attitudes to programming learning and weaker influence of family economic capital.Conclusion: The main factors that influence creativity in the context of programming education are programming teaching method, programming teaching management, programming learning approach, programming learning attitude, programming learning engagement and family economic capital. Among these, learner factors (attitude, engagement, and approach) and family economic capital are the key factors influencing creativity. These findings provide a basis for improving the creativity of Chinese programming learners and inspire teachers to consider learner factors and gender differences as they design and manage their instruction. Furthermore, the influence of family economic capital on the creativity of learners cannot be ignored.