The study aims to explore the effect of family function on non-suicidal self-injury (NSSI) among Chinese urban adolescents with and without parental migration. Between April 21st to May 12th, 2021, adolescents were recruited from Shenzhen city of Guangdong province, China (n = 124,357). Of all the participants, 22,855 (18.4%) were left-behind children (LBC). Family function, NSSI, depression, and socio-demographic characteristics were assessed using a series of self-reported questionnaires. Urban LBC had a higher NSSI frequency, while a lower level of family function than non-LBC. After controlling for confounders, parental migration was significantly associated with NSSI, and family dysfunction was a robust risk factor for NSSI as well. The protective effect of family function on NSSI of LBC was stronger than non-LBC. This implies that children with higher levels of family function tend to exhibit a lower frequency of NSSI, especially in those with parental migration. In practice, adolescents’ NSSI prevention and intervention strategies should focus on improving family function.