BACKGROUND: Combination antiretroviral therapy has led to increased survival among youth with perinatally acquired HIV (PHIV). However, cognitive deficits continue to be common. Histopathological studies in adults have found HIV concentrated in subcortical structures, which are involved in sensory processing, movement, and higher-order cognition that emerges with development. METHODS: We conducted magnetic resonance imaging and cognitive testing in 40 youth with PHIV at one site of the Adolescent Master Protocol of the Pediatric HIV/AIDS Cohort Study. We collected HIV disease-severity measures and substance-use reports. Subcortical volume and shape deformation were generated with FreeSurfer-Initiated Large Deformation Diffeomorphic Metric Mapping. Inward shape deformation was defined as negative displacement. We evaluated associations of subcortical shape deformation with past HIV severity after adjustment for sex, age at neuroimaging, age at HIV severity marker, and substance use. We examined associations between subcortical deformation and cognitive function. RESULTS: Negative correlations between shape deformation and peak HIV viral load (VL) were found in clusters in the caudate tail, globus pallidus, lateral putamen, and anterior and medial thalamus. Positive correlations between shape deformation and nadir CD4-positive T-lymphocyte percentage (CD4%) were found in clusters in the medial and posterior thalamus. Inward deformation in caudate and thalamic clusters correlated with worse cognition. CONCLUSIONS: Youth with PHIV have demonstrable subcortical shape deformation related to past HIV severity and cognition; inward deformation was associated with higher peak VL, lower nadir CD4%, and worse cognition. Identifying subcortical deformation may inform clinical practice for early intervention to help improve cognitive outcomes and assess the neuroefficacy of combination antiretroviral therapy in youth with PHIV.