Red coloration is a salient feature of the natural world. Many vertebrates produce red color by converting dietary yellow carotenoids into red ketocarotenoids via an unknown mechanism. Here, we show that two enzymes, cytochrome P450 2J19 (CYP2J19) and 3-hydroxybutyrate dehydrogenase 1-like (BDH1L), are sufficient to catalyze this conversion. In birds, both enzymes are expressed at the sites of ketocarotenoid biosynthesis (feather follicles and red cone photoreceptors), and genetic evidence implicates these enzymes in yellow/red color variation in feathers. In fish, the homologs of CYP2J19 and BDH1L are required for ketocarotenoid production, and we show that these enzymes are sufficient to produce ketocarotenoids in cell culture and when ectopically expressed in fish skin. Finally, we demonstrate that the red-cone-enriched tetratricopeptide repeat protein 39B (TTC39B) enhances ketocarotenoid production when co-expressed with CYP2J19 and BDH1L. The discovery of this mechanism of ketocarotenoid biosynthesis has major implications for understanding the evolution of color diversity in vertebrates.