Abstract The spectral characteristics of vertebrate ocular lenses affect the image of the world that is projected onto the retina, and thus help shape diverse visual capabilities. Here, we tested whether amphibian lens transmission is driven by adaptation to diurnal activity (bright light) and/or scansorial habits (complex visual environments). Spectral transmission through the lenses of 79 species of frogs and six species of salamanders was measured, and data for 29 additional frog species compiled from published literature. Phylogenetic comparative methods were used to test ecological explanations of variation in lens transmission and to test for selection across traits. Lenses of diurnal (day‐active) and scansorial (climbing) frogs transmitted significantly less shortwave light than those of non‐diurnal or non‐scansorial amphibians, and evolutionary modelling suggested that these differences have resulted from differential selection. The presence of shortwave‐transparent lenses was common among the sampled amphibians, which implies that many are sensitive to shortwave light to some degree even in the absence of visual pigments maximally sensitive in the UV. This suggests that shortwave light, including UV, could play an important role in amphibian behaviour and ecology. Shortwave‐absorbing lens pigments likely provide higher visual acuity to diurnally active frogs of multiple ecologies and to nocturnally active scansorial frogs. This new mechanistic understanding of amphibian visual systems suggests that shortwave‐filtering lenses are adaptive not only in daylight conditions but also in those scotopic conditions where high acuity is advantageous. Read the free Plain Language Summary for this article on the Journal blog.