Body colorations have been investigated intensely concerning their adaptive significance from the ecological and evolutionary perspectives. Melanism has gathered growing attention thanks to its marked variability across space, time and taxon and, in ectotherms, it has been hypothesised to be driven by thermal advantages. Among reptiles, vipers show conspicuous inter- and intraspecific patterns of variation, making them excellent models to address evolutionary and adaptive patterns. We investigated the thermal melanism hypothesis across Viperidae by performing a phylogenetic comparative approach to assess whether its occurrence is phylogenetically driven or, alternatively, whether it is influenced by climate. We found no phylogenetic signal of melanism and reconstructed the ”non-melanic” form as the ancestral state at the root of their phylogeny, whereas a climatic effect was found so that melanism is more frequent in colder environments. With this work we provide, for the first time and on a large scale, strong support to the TMH in ectotherms; moreover, we hypothesize that melanism has evolved in multiple events throughout the diversification of vipers, and that it has been maintained only when its role as a response to sub-optimal environments counterbalances and overcomes the trade-off with fitness decrease due to higher predation risk.