BackgroundTo investigate the association between coping styles, gender, their interactions and non-suicidal self-injurious (NSSI) behaviors among middle school students in rural western China under COVID-19.MethodsA multicentre cross-sectional study method was used to conduct an online survey of 8,361 students from 23 middle schools in the northern Sichuan region by clustering sampling, using the General Information Questionnaire, the Ottawa Self-Injury Inventory, and the Coping Style Scale for Middle School Students.ResultsThe past year prevalence of NSSI among middle school students in rural west China was 5.7%. The differences in scores between those with and without NSSI on all dimensions of coping styles were statistically significant (p < 0.001). Multivariate logistic regression analysis revealed that vocational high school (OR = 1.67), girls (OR = 2.5), single parent with divorced parents (OR = 1.89), remarriage with divorced parents (OR = 1.81), and tolerance (OR = 1.17), venting emotions (OR = 1.15) and fantasy/denial (OR = 1.07) in coping styles may increase the risk of NSSI among middle school students, while problem solving (OR = 0.9) and seeking social support (OR = 0.9) among coping styles may reduce the risk of NSSI among middle school students. The interaction results show that gender has a moderating role in the process of endurance, avoidance, venting of emotions, and fantasy/denial influencing non-suicidal self-injury in middle school students.ConclusionThere is an association between coping styles and self-injury among middle school students in rural areas in western China, with gender playing a moderating role. Active attention should be paid to students' coping styles and encouraging them to adopt positive coping styles as well as avoid negative coping styles, especially in the case of girls, which can help prevent self-injury.