Vitamin D comes from three main sources: your own skin when it’s exposed to sunlight, a small number of foods (mostly fatty fish), and fortified products or supplements. Of these, sunlight is the dominant source for most people. Your skin manufactures vitamin D when ultraviolet B rays hit a cholesterol compound sitting in the outer layer of your skin, converting it into a precursor that eventually becomes the active vitamin your body uses.
How Your Skin Makes Vitamin D
The raw material for vitamin D is already in your skin. A compound called 7-dehydrocholesterol, which sits on one of the body’s cholesterol-production pathways, absorbs UVB radiation in the 295 to 315 nanometer wavelength range. That energy breaks open part of the molecule’s ring structure, creating a precursor called pre-vitamin D3. Body heat then rearranges this precursor into vitamin D3, which enters the bloodstream.
This process is heavily dependent on the angle of the sun. UVB intensity changes with latitude, season, and time of day, which is why people living farther from the equator produce far less vitamin D during winter months. At high latitudes in winter, the sun never climbs high enough in the sky to deliver meaningful UVB, and synthesis essentially stops.
Skin pigmentation also plays a significant role. The pigment eumelanin, which gives skin its darker color, absorbs UVB radiation before it can reach the cholesterol precursor. Research has found a strong inverse relationship between skin pigmentation and circulating vitamin D levels: people with darker skin have significantly lower blood concentrations of vitamin D on average, and face a greater risk of deficiency, particularly at higher latitudes.
Foods That Naturally Contain Vitamin D
Very few foods contain vitamin D in meaningful amounts, and nearly all of them are animal-based. Fatty fish are by far the richest natural source. A 3-ounce serving of cooked swordfish provides about 566 IU, while the same amount of canned pink salmon delivers roughly 493 IU. Rainbow trout is similarly rich, with a single cooked fillet containing around 539 IU. Spanish mackerel and pickled herring offer smaller but still useful amounts.
Beyond fish, the options thin out quickly. Egg yolks contain some vitamin D, but the amounts are modest, around 35 IU per ounce of yolk. Liver provides even less. This is why fish has historically been so important for populations living in northern climates with limited sun exposure.
Mushrooms: The Plant-Based Exception
Mushrooms are the only significant non-animal food source of vitamin D, and they produce it through a process remarkably similar to human skin. When mushrooms are exposed to UV light, a compound in their cell membranes converts into vitamin D2 (a slightly different form than the D3 made in human skin). The catch is that most commercially grown mushrooms are raised in the dark and contain almost none.
When mushrooms are deliberately placed in sunlight, the results are dramatic. Sliced button mushrooms exposed to midday summer sun in one study generated 17.5 micrograms of vitamin D2 per 100 grams after just 15 minutes, rising to 32.5 micrograms after an hour. That 15-minute figure already approaches the daily recommended intake in many countries. Oyster mushrooms are especially responsive, producing more than double the vitamin D2 of shiitake mushrooms at the same UV exposure level.
Some grocery stores now sell UV-treated mushrooms labeled as a vitamin D source. Commercial pulsed UV lamps can generate nutritionally relevant levels of vitamin D2 in mushrooms in as little as one to two seconds. If you buy regular mushrooms, placing them gill-side up in direct sunlight for 15 to 60 minutes before eating them will boost their vitamin D content substantially. The levels do decline somewhat with storage and cooking, but remain meaningful if you eat them before the best-before date.
Fortified Foods
Because natural food sources are so limited, many countries fortify staple products with vitamin D. In the United States, all fluid pasteurized milk must contain a minimum of 400 IU of vitamin D per quart. Many brands of orange juice, plant-based milks, and breakfast cereals are also fortified, though the amounts vary by product. For people who don’t eat fish regularly or get consistent sun exposure, fortified foods often represent the most reliable dietary source.
D2 vs. D3 in Supplements
Vitamin D supplements come in two forms: D2 (ergocalciferol), derived from plants and fungi, and D3 (cholecalciferol), the same form your skin produces. Both are inactive when you swallow them and require the same activation process in your body. However, they are not equally effective at raising blood levels.
D3 is consistently more potent. A systematic review and meta-analysis concluded that D3 is more effective than D2 at increasing circulating vitamin D, and one study found D3 had roughly 87% greater potency than D2 at the same dose. Another found D2 to be about one-third the potency of D3. Even when D2 was given at double the dose, it failed to match D3’s effect on blood levels. For this reason, most health professionals prefer D3 supplements when the goal is correcting a deficiency. D2 remains useful for people who avoid animal products, since D3 is typically sourced from lanolin (sheep’s wool oil) or fish oil, though vegan D3 derived from lichen is now available.
How Your Body Activates Vitamin D
Regardless of where it comes from, vitamin D is biologically inert when it first enters your bloodstream. It must go through two chemical conversions before your body can use it. First, the liver converts it into a form called calcidiol, which is the main circulating form and what doctors measure in a blood test. Then the kidneys convert calcidiol into calcitriol, the fully active hormone that regulates calcium absorption, bone metabolism, and immune function.
This two-step activation is why liver and kidney health matter for vitamin D status. Someone with impaired kidney function, for example, can have adequate calcidiol levels in their blood but still struggle to produce enough of the active form.
How Much You Need
The recommended daily intake is 400 IU for infants up to 12 months, 600 IU for ages 1 through 70, and 800 IU for adults over 70. These numbers assume minimal sun exposure. In practice, many people fall short, particularly during winter, in northern latitudes, or if they have darker skin, spend most of their time indoors, or consistently wear sunscreen.
A combination of moderate sun exposure, fatty fish or fortified foods a few times per week, and a D3 supplement during low-sun months covers the gap for most people. If you’re unsure about your status, a simple blood test measuring calcidiol (often listed as 25-hydroxyvitamin D) gives a clear picture. Levels below 20 ng/mL are generally considered deficient, while 20 to 30 ng/mL is considered insufficient.

