Although several studies have shown that ultraviolet (UV) wavelengths are important in naturally occurring, visually guided behaviours of vertebrates, the function of the UV cone in such behaviours is unknown. Here, I used thyroid hormone to transform the UV cones of young rainbow trout into blue cones, a phenomenon that occurs naturally as the animal grows, to test whether the resulting loss of UV sensitivity affected the animal's foraging performance on Daphnia magna, a prey zooplankton. The distances and angles at which prey were located (variables that are known indicators of foraging performance) were significantly reduced for UV knock-out fish compared with controls. Optical measurements and photon-catch calculations revealed that the contrast of Daphnia was greater when perceived by the visual system of control versus that of thyroid-hormone-treated fish, demonstrating that the UV cone enhanced the foraging performance of young rainbow trout. Because most juvenile fishes have UV cones and feed on zooplankton, this finding has wide implications for understanding the visual ecology of fishes. The enhanced target contrast provided by UV cones could be used by other vertebrates in various behaviours, including foraging, mate selection and communication.