The concept of sustainable development has gained significant traction in recent years, leading to a growing emphasis on green consumption. Previous studies have rarely emphasized the important role of sustainability awareness in influencing green consumption. This study explores the mechanism of the influence of sustainability awareness on green purchase intention, using the theory of planned behavior as a conceptual framework. The aim is to contribute to the promotion of environmental protection and green consumption. The research used an online five-point Likert scale questionnaire and collected data from university students in China. Useable data were collected from 419 respondents and were then validated and analyzed using structural equation modeling (SEM) and the PROCESS macro for SPSS 22.0. The findings suggest that attitudes toward green purchases, subjective norms, and perceived behavioral control have a positive effect on green purchase intention; sustainability awareness significantly and positively moderates the direct effect of attitudes toward green purchases on green purchase intention and the predictive effect of subjective norms on green purchase intention; and sustainability awareness significantly and negatively moderates the direct effect of perceived behavioral control on green purchase intention. The findings can be used to develop strategies that influence university students’ intention to purchase green products.