BackgroundPrevious studies have shown a correlation between childhood trauma and social anxiety. However, the underlying mechanism of this association is not well understood. ObjectiveThe aim of this study was to examine the relationship between childhood trauma and social anxiety in adolescents, and to explore the mediating role of self-compassion and loneliness. Participants and settingIn total 1309 adolescents (531 of whom were female) were recruited, and their mean age was 15.4 ± 2.30 years. MethodsParticipants completed the Adolescent Social Anxiety Scale, Childhood Trauma Questionnaire Short Form, Self-Compassion Scale, and University of California, Los Angeles Loneliness Scale. Pearson correlation analysis was conducted to investigate the relationships among childhood trauma, self-compassion, loneliness, and social anxiety. The PROCESS Macro Model 80 was used for regression analysis to explore the mediating effects of self-compassion and loneliness on the relationship between childhood trauma and social anxiety. ResultsAfter controlling for the influence of gender and parental marital status, self-compassion mediated the association between childhood trauma and social anxiety, in which positive self-compassion alleviated the relationship between childhood trauma and social anxiety, while negative self-compassion aggravated the relationship between childhood trauma and social anxiety. Furthermore, self-compassion and loneliness chain-mediated the relationship between childhood trauma and social anxiety. ConclusionThese results offer theoretical support for the research and intervention of adolescents' social anxiety, and are crucial for developing adolescents' mental health education and promoting interpersonal communication.