Variation in habitat quality is common across terrestrial, freshwater, and marine habitats. We investigated how habitat quality influenced the reproductive potential of mud crabs across 30 oyster reefs that were degraded to different extents. We further coupled this field survey with a laboratory experiment designed to mechanistically determine the relationship between resource consumption and reproductive performance. We show a >10-fold difference in average reproductive potential for crabs across reefs of different quality. Calculated consumption rates for crabs in each reef, based on a type II functional response, suggest that differences in reproductive performance may be attributed to resource limitation in poor quality reefs. This conclusion is supported by results of our laboratory experiment where crabs fed a higher quality diet of abundant animal tissue had greater reproductive performance. Our results demonstrate that spatial variation in habitat quality can be a considerable contributor to within-population individual variation in reproductive success (i.e., demographic heterogeneity). This finding has important implications for assessing population extinction risk.