ImportanceMany youths experience mental health challenges. Identifying which neighborhood and community factors may influence mental health may guide health policy and practice.ObjectiveTo explore associations between community assets (eg, schools, parks, libraries, and barbershops) and past-year mental health symptoms among youths.Design, Setting, and ParticipantsThis cross-sectional study leveraged 3 datasets, which were linked by 26 zip codes: the Western Pennsylvania Regional Data Center, the Child Opportunity Index 2.0 database, and the Allegheny County Youth Risk Behavior Survey (YRBS). The YRBS was administered during the study period in 2018 to youths across 13 high schools in Allegheny County, Pennsylvania; the study dates were from October 15 to October 19, 2018. Dates of analysis were from August 1, 2023, to July 15, 2024.ExposuresAsset density in each zip code across 8 asset categories (transportation, education, parks and recreation, faith-based entities, health services, food resources, personal care services, and social infrastructure) was calculated.Main Outcomes and MeasuresThe main outcomes were mental health measures included in the past 12 months, which comprised feelings of hopelessness (feeing so sad or hopeless that you stopped doing activities), nonsuicidal self-injury (hurt yourself on purpose without wanting to die), and suicidal ideation (seriously considered attempting suicide). All were operationalized to any or none. Data were analyzed using multivariable generalized linear mixed models and were adjusted for age, sex assigned at birth, race and ethnicity, and identification as sexually or gender diverse.ResultsAmong 6306 students who were eligible for the YRBS based on their enrollment in participating high schools, 4487 students completed surveys, and 2162 were included in the analytic sample (mean [SD] age, 15.8 [1.2] years; 1245 [57.6%] were assigned female sex at birth). Over one-third of the participants (811 [37.5%]) reported past-year feelings of hopelessness; 587 (27.2%), past-year nonsuicidal self-injury; and 450 (20.8%), past-year suicidal ideation. High total asset population density (adjusted odds ratio [AOR], 0.85 [95% CI, 0.75-0.97]; P = .01), as well as population density of transportation assets (AOR, 0.77 [95% CI, 0.66-0.90]; P < .001), educational resources (AOR, 0.78 [95% CI, 0.67-0.92]; P = .002), and health services (AOR, 0.74 [95% CI, 0.60-0.91]; P = .006), were associated with lower odds of past-year hopelessness after adjusting for covariates. There were no correlations between asset density, Child Opportunity Index, and other mental health measures.Conclusions and RelevanceThe findings of this cross-sectional study suggest that access to certain community assets was associated with lower odds of feelings of hopelessness among youths. Ongoing work is needed to characterize other forms of social and cultural capital, which may mitigate negative mental health outcomes among adolescent youths.