Ergosterol (provitamin D(2)) is converted to vitamin D(2) in grass by exposure to UV light. Six varieties of perennial ryegrass (Lolium perenne L.) were harvested four times during the season, and the contents of vitamin D(2) and ergosterol were analyzed by a sensitive and selective liquid chromatography tandem mass spectrometry method. Weather factors were recorded, and a principal component analysis was performed to study which factors were important for the formation of vitamin D(2). The results suggest that a combination of weather factors is involved and that the contents of ergosterol and vitamin D(2) change more than a factor of 10 during the season. These results demonstrate that grass potentially can be a significant source of vitamin D for grazing animals and animals fed on silage and hay.