Melanin is a widespread pigment causing variation in skin darkness, with darker phenotypes typically reaching higher equilibrium temperatures than lighter ones. Therefore, selection is expected to favour darker phenotypes in colder environments. In the present study, we show intraspecific variation in pupal (and wing) melanization along an altitudinal gradient in two species of copper butterflies. Both, pupal and wing melanization increased with increasing altitude. Consistent with the thermal melanism hypothesis, darker (high-altitude) pupae reached higher equilibrium temperatures than paler (low-altitude) ones. However, as temperature differences were rather small despite pronounced differences in melanization, we cannot rule out that factors (e.g. ultraviolet protection, disease resistance) other than temperature comprise the principal selective agents. Mechanistically, variation in melanization might be related to variation in hormone titres, as demonstrated by low-altitude pupae showing higher ecdysteroid and juvenile hormone titres compared to high-altitude ones. Furthermore, we report sex differences in wing melanization, with males being darker than females, which is potentially related to a higher flight activity of males.