Keratins are the main intermediate filament proteins of epithelial cells. In keratinocytes of the mammalian epidermis they form a cytoskeleton that resists mechanical stress and thereby are essential for the function of the skin as a barrier against the environment. Here, we performed a comparative genomics study of epidermal keratin genes in terrestrial and fully aquatic mammals to determine adaptations of the epidermal keratin cytoskeleton to different environments. We show that keratins K5 and K14 of the innermost (basal), proliferation-competent layer of the epidermis are conserved in all mammals investigated. In contrast, K1 and K10, which form the main part of the cytoskeleton in the outer (suprabasal) layers of the epidermis of terrestrial mammals, have been lost in whales and dolphins (cetaceans) and in the manatee. Whereas in terrestrial mammalian epidermis K6 and K17 are expressed only upon stress-induced epidermal thickening, high levels of K6 and K17 are consistently present in dolphin skin, indicating constitutive expression and substitution of K1 and K10. K2 and K9, which are expressed in a body site-restricted manner in human and mouse suprabasal epidermis, have been lost not only in cetaceans and manatee but also in some terrestrial mammals. The evolution of alternative splicing of K10 and differentiation-dependent upregulation of K23 have increased the complexity of keratin expression in the epidermis of terrestrial mammals. Taken together, these results reveal evolutionary diversification of the epidermal cytoskeleton in mammals and suggest a complete replacement of the quantitatively predominant epidermal proteins of terrestrial mammals by originally stress-inducible keratins in cetaceans.