Vertebrates obtain the prohormone vitamin D primarily by endogenous cutaneous synthesis under ultraviolet b (UVb) exposure. To date, endogenous synthesis of vitamin D in insects has never been investigated. In an initial experiment, we exposed four insect species which differ in ecology and morphology (migratory locusts, house crickets, yellow mealworms and black soldier fly larvae (BSFL)) to a low irradiance UVb source. In a second experiment we exposed these species to a higher UV irradiance, and in a third we tested the effect of exposure duration on vitamin D concentrations in yellow mealworms. Low irradiance UVb tended to increase vitamin D3 levels in house crickets, vitamin D2 levels in BSFL and vitamin D2 and D3 in yellow mealworms. Higher UVb irradiance increased vitamin D3 levels in all species but BSFL. Both BSFL and migratory locusts had increased vitamin D2 levels. Longer UVb exposure of yellow mealworms increased vitamin D2 and increased vitamin D3 until a plateau was reached at 6400 IU/kg. This study shows that insects can synthesize vitamin D de novo and that the amounts depend on UVb irradiance and exposure duration.