Since the 1940s, the distributions of several butterfly species have been expanding in northern Europe, probably in response to climate warming. We focus on the speckled wood butterfly Pararge aegeria in order to determine impacts of habitat availability on expansion rates. We analyse observed expansion rates since 1940 and also use a spatially explicit mechanistic model (MIGRATE) to simulate range expansion in two areas of the UK which differ in their distribution of breeding habitat (woodland). Observed and simulated expansion rates were in very close agreement but were 42%–45% slower in an area that had 24% less woodland. Unlike P. aegeria, the majority of butterfly species are not currently expanding, almost certainly because of lack of suitable habitat. Incorporating the spatial distribution of habitat into investigations of range changes is likely to be important in determining those species that can and cannot expand, and for predicting potential future range changes.