OBJECTIVE: HIV prevalence trends suggest that the epidemic is stable or declining in many sub-Saharan African countries. However, trends might differ between socioeconomic groups. Educational attainment is a common measure of socioeconomic position in HIV datasets from Africa. Several studies have shown higher HIV prevalence among more educated groups, but this may change over time. We describe changes in HIV prevalence by educational attainment in Tanzania from 2003 to 2007. DESIGN AND METHODS: Analysis of data from two large, nationally representative HIV prevalence surveys conducted among adults aged 15-49 years in Tanzania in 2003-2004 (10 934 participants) and 2007-2008 (15 542 participants). We explored whether changes in HIV prevalence differed between groups with different levels of educational attainment after adjustment for potential confounding factors (sex, age, urban/rural residence and household wealth). RESULTS: Changes in HIV prevalence differed by educational attainment level (interaction test P value = 0.07). HIV prevalence was stable among those with no education (adjusted odds ratio 2007-2008 vs. 2003-2004 1.03, 95% confidence interval 0.72-1.47), whereas showing a small but borderline significant decline among those with primary education (adjusted odds ratio 0.85, 95% confidence interval 0.69-1.03) and a larger statistically significant decline among those with secondary education (adjusted odds ratio 0.53, 95% confidence interval 0.34-0.84). DISCUSSION: Prevalent HIV infections are now concentrating among those with the lowest levels of education in Tanzania. Although HIV-related mortality, migration and cohort effects might contribute to this, different HIV incidence by educational level between the surveys provides the most likely explanation. Urgent measures to improve HIV prevention among those with limited education and of low socioeconomic position are necessary in Tanzania.