This study investigates mental health literacy among young and middle-aged urban and rural residents and the differences in mental health literacy, perceived social support and subjective well-being. From January to February 2022, 620 participants (320 rural and 300 urban residents) from three provinces of China were selected by convenience sampling. A general data questionnaire, mental health literacy scale, perceived social support scale and subjective well-being scale were administered. The mental health literacy scores of urban residents were 3.34 ± 0.57 and those of rural residents were 2.73 ± 0.79. The results of multiple regression analysis showed that the mental health literacy scores of rural residents were more significant than those of urban residents in terms of sex and age, while urban residents' mental health literacy scores were more significant than those of rural residents in terms of monthly income. Mental health literacy, perceived social support and subjective well-being of young and middle-aged urban and rural residents were all positively correlated (P < 0.01). While the level of mental health literacy is better among urban residents than rural residents, perceived social support plays a partial mediating role between mental health literacy and subjective well-being of both urban and rural residents, and should be the focus of researchers seeking to improve the level of well-being of residents.