A rapidly growing body of literature documents the potential negative effects of CO2-driven ocean acidification (OA) on marine organisms. However, nearly all this work has focused on the effects of future conditions on modern populations, neglecting the role of adaptation. Rapid evolution can alter demographic responses to environmental change, ultimately affecting the likelihood of population persistence, but the capacity for adaptation will differ among populations and species. Here, we measure the capacity of the ecologically important purple sea urchin Strongylocentrotus purpuratus to adapt to OA, using a breeding experiment to estimate additive genetic variance for larval size (an important component of fitness) under future high-pCO2/low-pH conditions. Although larvae reared under future conditions were smaller than those reared under present-day conditions, we show that there is also abundant genetic variation for body size under elevated pCO2, indicating that this trait can evolve. The observed heritability of size was 0.40 ± 0.32 (95% CI) under low pCO2, and 0.50 ± 0.30 under high-pCO2 conditions. Accounting for the observed genetic variation in models of future larval size and demographic rates substantially alters projections of performance for this species in the future ocean. Importantly, our model shows that after incorporating the effects of adaptation, the OA-driven decrease in population growth rate is up to 50% smaller, than that predicted by the ‘no-adaptation’ scenario. Adults used in the experiment were collected from two sites on the coast of the Northeast Pacific that are characterized by different pH regimes, as measured by autonomous sensors. Comparing results between sites, we also found subtle differences in larval size under high-pCO2 rearing conditions, consistent with local adaptation to carbonate chemistry in the field. These results suggest that spatially varying selection may help to maintain genetic variation necessary for adaptation to future OA.