Myopia has become a major public health concern, particularly across much of Asia. It has been shown in multiple studies that outdoor activity has a protective effect on myopia. Recent reports have shown that short-wavelength visible violet light is the component of sunlight that appears to play an important role in preventing myopia progression in mice, chicks, and humans. The mechanism underlying this effect has not been understood. Here,we show that violet light prevents lens defocus–induced myopia in mice. This violet light effect was dependent on both time of day and retinal expression of the violet light sensitive atypical opsin, neuropsin (OPN5). These findings identifyOpn5-expressing retinal ganglion cells as crucial for emmetropization in mice and suggest a strategy for myopia prevention in humans.