How should schools assign students to more rigorous math courses so as best to help their academic outcomes? We identify several hundred California middle schools that used 7th-grade test scores to place students into 8th-grade algebra courses and use a regression discontinuity design to estimate average impacts and heterogeneity across schools. Enrolling in 8th-grade algebra boosts students' enrollment in advanced math in ninth grade by 30 percentage points and eleventh grade by 16 percentage points. Math scores in tenth grade rise by 0.05 standard deviations. Women, students of color, and English-language learners benefit disproportionately from placement into early algebra. Importantly, the benefits of 8th-grade algebra are substantially larger in schools that set their eligibility threshold higher in the baseline achievement distribution. This suggests a potential tradeoff between increased access and rates of subsequent math success.