HIV/AIDS is a leading cause of disease burden in sub-Saharan Africa. Existing evidence has demonstrated that there is substantial local variation in the prevalence of HIV; however, subnational variation has not been investigated at a high spatial resolution across the continent. Here we explore within-country variation at a 5 × 5-km resolution in sub-Saharan Africa by estimating the prevalence of HIV among adults (aged 15–49 years) and the corresponding number of people living with HIV from 2000 to 2017. Our analysis reveals substantial within-country variation in the prevalence of HIV throughout sub-Saharan Africa and local differences in both the direction and rate of change in HIV prevalence between 2000 and 2017, highlighting the degree to which important local differences are masked when examining trends at the country level. These fine-scale estimates of HIV prevalence across space and time provide an important tool for precisely targeting the interventions that are necessary to bringing HIV infections under control in sub-Saharan Africa.