Camouflage is widespread throughout the natural world and conceals animals from predators in a vast range of habitats. Because successful camouflage usually involves matching aspects of the background environment, species and populations should evolve appearances tuned to their local habitat, termed phenotype-environment associations. However, although this has been studied in various species, little work has objectively quantified the appearances of camouflaged animals from different habitats, or related this to factors such as ontogeny and individual variation. Here, we tested for phenotype-environment associations in the common shore crab (Carcinus maenas), a species highly variable in appearance and found in a wide range of habitats. We used field surveys and digital image analysis of the colors and patterns of crabs found in four locations around Cornwall in the UK to quantify how individuals vary with habitat (predominantly rockpool, mussel bed, and mudflat). We find that individuals from sites comprising different backgrounds show substantial differences in several aspects of color and pattern, and that this is also dependent on life stage (adult or juvenile). Furthermore, the level of individual variation is dependent on site and life stage, with juvenile crabs often more variable than adults, and individuals from more homogenous habitats less diverse. Ours is the most comprehensive study to date exploring phenotype-environment associations for camouflage and individual variation in a species, and we discuss the implications of our results in terms of the mechanisms and selection pressures that may drive this.