Healthy Weather

The Science behind the App

Sun, UV & Vitamin D₃

This page documents how the app calculates the vitamin D₃ part of its numbers, what science backs each step, and how accurate the results are. The goal is full transparency.

Where the data comes from

All weather and UV data comes from  Weather (Apple WeatherKit), fetched directly on your device — the app has no backend server of its own.

The UV Index (UVI) provided by Apple Weather is itself a model output, computed from total column ozone, cloud cover, aerosols, and solar position. It represents the erythemal (sunburn-weighted) UV irradiance at the surface. Apple provides it at hourly resolution; the app interpolates it to the 15-minute grid used throughout. We validated this interpolation against native 15-minute reference data across 11 locations and 4 weeks of mixed sky conditions: it changes the daily vitamin-D integral by about 1.5% in the median — well inside the model’s overall accuracy bounds below.

Solar altitude — the sun’s angle above the horizon at your location — is computed on-device from your coordinates and the current time using the standard NOAA solar position equations (verified against the NREL Solar Position Algorithm to within 0.01°).

Step 1: From UVI to vitamin D₃ potential (VDI)

UVI is weighted across the UVA and UVB spectrum, but vitamin D₃ synthesis only responds to UVB (280–315 nm). UVB is absorbed by stratospheric ozone far more strongly than UVA, and the path through ozone gets longer when the sun is low in the sky (the air mass is greater). So at low sun angles, UVI overestimates the vitamin-D₃-relevant UV reaching your skin.

To correct for this, we compute a Vitamin D₃ Index (VDI) that converts erythemal UVI into a vitamin-D₃-weighted equivalent. VDI is custom to Healthy Weather — it’s not a standardized metric used elsewhere. We designed it specifically to give users a single number that represents “how good is the sun right now for making vitamin D₃”:

air_mass = 1 / sin(solar_altitude)
VDI = (UVI / 3.0) × exp(-0.25 × (air_mass - 1))

The exponential term applies a Beer-Lambert correction for differential ozone absorption between UVA and UVB. The constant 0.25 is fit to the empirical data in McKenzie, Liley & Björn (2009), “UV Radiation: Balancing Risks and Benefits,” Photochemistry and Photobiology 85(1):88–98 — specifically Figure 4b, which shows the UVvitD/UVery ratio as a function of solar zenith angle at 300 Dobson Units of total column ozone.

The scale we chose: VDI is anchored so that VDI = 1 corresponds to UVI 3 with the sun directly overhead — roughly the threshold above which meaningful vitamin D₃ synthesis begins in fair skin. We deliberately kept the formula continuous below that threshold rather than clipping to zero, because some minimal synthesis genuinely does occur at lower irradiances and we wanted to reflect that honestly.

Typical range: VDI runs from 0 to about 3.5. Values of 0.5–1 indicate marginal conditions, 1–2 is good for vitamin D₃ production, and 2+ is strong. VDI returns 0 below 15° solar altitude or at UVI 0 — below this threshold the atmospheric path is long enough that essentially no UVB reaches the surface, consistent with the “vitamin D₃ winter” observation in Webb, Kline & Holick (1988), Influence of Season and Latitude on the Cutaneous Synthesis of Vitamin D3, Journal of Clinical Endocrinology & Metabolism 67:373–378.

Step 2: Cloud cover override

VDI as described above is what the app displays by default everywhere — based on the live UVI from Apple Weather, which already incorporates modeled cloud cover.

When you start a tracking session, the app offers a manual cloud override. This is useful when the model’s cloud forecast doesn’t match what you actually see at your location (the model works on a grid; your spot is a single point). In override mode, the app first estimates the clear-sky UVI — by inverting the attenuation formula below against Apple’s UVI and cloud-cover data when skies are mostly clear, blending toward a solar-elevation-based clear-sky curve when it’s overcast — and then applies your cloud setting as the attenuation factor:

cloud_factor = 1 - cloud_cover × 0.6

The 0.6 coefficient means a fully overcast sky still passes 40% of UVB — clouds attenuate but don’t block UV completely.

Step 3: From VDI to personal vitamin D₃ synthesis

VDI is an environmental quantity. To convert it to vitamin D₃ actually produced in your skin, the app multiplies by a synthesis factor that captures four personal variables.

synthesis_factor = skin_factor × age_factor × exposure_factor × sunscreen_factor

Skin type

Cutaneous vitamin D₃ synthesis depends strongly on melanin content, since melanin absorbs UVB before it can reach the 7-dehydrocholesterol that becomes vitamin D₃. The app uses these factors for Fitzpatrick types I through VI:

[1.1, 1.0, 0.7, 0.5, 0.35, 0.25]

Type II is the reference (factor 1.0). The relative differences are based on:

Older models often use a steeper penalty for darker skin types. We use the flatter vector to better reflect the post-2010 evidence that melanin’s effect on D3 synthesis is less severe when normalized to UV dose received at the skin.

Age

The concentration of 7-dehydrocholesterol — the precursor molecule that converts to vitamin D₃ — declines with age. The app uses:

age_factor = max(0.4, 1 - 0.01 × max(0, age - 20))

This implements roughly a 1% per year decline starting at age 20, with a floor at 40% of peak production. At age 70 the factor is 0.5, matching the approximately 50% reduction reported in MacLaughlin & Holick (1985), Aging Decreases the Capacity of Human Skin to Produce Vitamin D3, Journal of Clinical Investigation 76(4):1536–1538. More recent work (Wagner et al. 2020, Vitamin D Synthesis Following a Single Bout of Sun Exposure in Older and Younger Men and Women, Nutrients 12(8):2237) suggests the slope may be gentler in healthy free-living elderly adults, but the MacLaughlin/Holick decline remains the reference value used in most photobiology models.

Exposed body surface area

Linear with body surface area exposed: 50% exposed = half synthesis. The app uses approximate body surface area (BSA) percentages based on the Wallace rule of nines:

These are approximations. Individual variation in clothing fit and BSA proportions can shift these by ±10%.

Sunscreen

Sunscreen labeled SPF 30 blocks ~97% of UVB at the application thickness used in lab testing (2 mg/cm²). But people typically apply 25–50% of that thickness in real use, and coverage is often patchy, so real-world UVB blocking is much lower than the SPF number implies. The app offers four levels:

Setting Factor Description
None 1.0 No sunscreen
Light 0.7 Spotty coverage, partially worn off, low SPF
Normal 0.4 Recently applied, decent coverage — typical real use
Diligent 0.2 Just applied, full coverage, generous amount, SPF 30+

The factor values are based on:

Step 4: From synthesis factor to IU per minute

The final calculation is:

iu_per_min = VDI × synthesis_factor × calibration_constant

The calibration constant is 290. It’s anchored to the experimental finding in McKenzie, Liley & Björn (2009): at UVI 10 with the sun overhead, full body exposure, and Fitzpatrick type II skin, cutaneous D3 production is approximately 1000 IU per minute. Solving for the constant:

1000 = (10/3) × 1.0 × 1.0 × 1.0 × 1.0 × C   →   C ≈ 300

Cross-validated against:

These three independent literature anchors give a defensible calibration range of C ≈ 190–300, and we use 290 as a slight conservative bias toward the McKenzie experimental anchor.

Saturation

Vitamin D synthesis in skin doesn’t continue indefinitely with longer sun exposure. The pre-vitamin D₃ in your skin reaches photochemical equilibrium with its inactive isomers (lumisterol and tachysterol) at roughly 10–20% conversion of available 7-dehydrocholesterol. Past this point, additional UVB exposure produces no additional vitamin D₃ — only sunburn.

This is documented in Holick, MacLaughlin & Doppelt (1981), Regulation of Cutaneous Previtamin D3 Photosynthesis in Man: Skin Pigment Is Not an Essential Regulator, Science 211(4482):590–593, and refined in subsequent work by Holick and Webb.

The app tracks cumulative IU and applies a soft saturation cap during sessions. Ceiling values used:

saturation_ceiling = 15,000 × skin_factor × exposure_factor

For a Fitzpatrick II in swimwear this gives ~12,000 IU before saturation, reached in ~15–20 minutes at UVI 7. As you approach saturation, the displayed IU/min tapers smoothly to zero. The app shows a saturation indicator above 50% to signal that further sun exposure won’t add much to your vitamin D₃ production.

Cross-session recovery

Skin saturation isn’t permanent. The pre-vitamin D₃ and the inactive isomers (lumisterol and tachysterol) slowly photoreconvert toward 7-dehydrocholesterol once you’re out of the sun — the same photochemical equilibrium described above, now running in reverse — so your available capacity recovers over time. The app models this as exponential decay with a ~11.5-hour half-life.

The practical consequence is that a new session doesn’t always start from zero. If you go back out a few hours after the last session, the app seeds your starting saturation from the most recent reading in your history, decayed by the time elapsed — so you begin part-way up the curve rather than at the bottom. After a full night out of the sun most of it has recovered, and after roughly two or more days it has effectively reset.

This decay model is biologically defensible but a simplification. Actual recovery depends on the relative pool sizes of pre-D3, D3, lumisterol, and tachysterol, and on how much of each the prior exposure built up. No single half-life captures that full dynamics; we use one parameter to approximate the practical recovery curve.

Target band: aim for 70–80%, not 100%

A useful target is roughly 70–80% saturation, not 100%. As saturation rises, the rate of new vitamin D₃ synthesis tapers in proportion — that is exactly what the saturation model represents. Past about 80%, continued sun exposure yields very little additional vitamin D₃ while you keep accumulating UV dose (and burn risk) at the same rate. Stopping around 70–80% captures most of the available vitamin D₃ for far less exposure.

In plain terms: your skin reaches a natural limit on how much vitamin D₃ it can produce per session, and you hit steeply diminishing returns well before the cap. 100% is not a goal. The indicator is there so you can see where you are on that curve; what you do with that information is up to you. This page describes how the model works, not medical guidance.

Accuracy

The app targets ±15% accuracy in typical conditions and ±20% across realistic ranges.

What this means in practice:

The app does not currently model:

We may add these in future versions if validation against real measurements suggests they materially improve accuracy.

What the app cannot tell you

The IU number the app shows is estimated cutaneous vitamin D₃ production, not your blood level (serum 25-hydroxyvitamin D₃). Converting between the two depends on body fat percentage (vitamin D₃ is fat-soluble and gets sequestered in adipose tissue), liver and kidney function, your starting baseline level, and dietary vitamin D₃ intake. The app does not estimate serum levels.

If you have specific medical concerns about your vitamin D₃ status, the only reliable measurement is a blood test ordered by a physician.

References

The complete bibliography for this page:

  1. McKenzie RL, Liley JB, Björn LO. UV Radiation: Balancing Risks and Benefits. Photochem Photobiol 2009;85(1):88–98.
  2. Webb AR, Kline L, Holick MF. Influence of Season and Latitude on the Cutaneous Synthesis of Vitamin D₃. J Clin Endocrinol Metab 1988;67:373–378.
  3. Webb AR, Engelsen O. Calculated Ultraviolet Exposure Levels for a Healthy Vitamin D Status. Photochem Photobiol 2006;82:1697–1703.
  4. Holick MF. Vitamin D Deficiency. N Engl J Med 2007;357:266–281.
  5. Clemens TL, Adams JS, Henderson SL, Holick MF. Increased Skin Pigment Reduces the Capacity of Skin to Synthesise Vitamin D₃. Lancet 1982;1(8263):74–76.
  6. MacLaughlin J, Holick MF. Aging Decreases the Capacity of Human Skin to Produce Vitamin D₃. J Clin Invest 1985;76(4):1536–1538.
  7. Holick MF, MacLaughlin JA, Doppelt SH. Regulation of Cutaneous Previtamin D₃ Photosynthesis in Man: Skin Pigment Is Not an Essential Regulator. Science 1981;211(4482):590–593.
  8. Matsuoka LY, Ide L, Wortsman J, MacLaughlin JA, Holick MF. Sunscreens Suppress Cutaneous Vitamin D3 Synthesis. J Clin Endocrinol Metab 1987;64:1165–1168.
  9. Faurschou A, Beyer DM, Schmedes A, Bogh MK, Philipsen PA, Wulf HC. The Relation Between Sunscreen Layer Thickness and Vitamin D Production after Ultraviolet B Exposure. Br J Dermatol 2012;167:391–395.
  10. Petersen B, Wulf HC. Application of Sunscreen — Theory and Reality. Photodermatol Photoimmunol Photomed 2014;30:96–101.
  11. Bogh MK, Schmedes AV, Philipsen PA, Thieden E, Wulf HC. Vitamin D Production after UVB Exposure Depends on Baseline Vitamin D and Total Cholesterol but Not on Skin Pigmentation. J Invest Dermatol 2010;130:546–553.
  12. Wagner CL et al. Vitamin D Synthesis Following a Single Bout of Sun Exposure in Older and Younger Men and Women. Nutrients 2020;12(8):2237.
  13. Young AR et al. Optimal Sunscreen Use During a Sun Holiday with a Very High Ultraviolet Index Allows Vitamin D Synthesis Without Sunburn. Br J Dermatol 2019.

If you have questions or spot something wrong, please reach out via our support page.