No. Ordinary window glass absorbs almost all UVB, the 290 to 315 nanometer band that turns 7-dehydrocholesterol in your skin into vitamin D3. The warmth you feel in a sunny window is infrared, and any tan you pick up through it is UVA. Neither makes vitamin D. For that you need open sky, or at least an open window.

The reason is a matter of wavelength. Vitamin D synthesis runs from about 290 to 315 nanometers and peaks near 297. Standard soda-lime float glass, the glass in nearly every house, office and car, transmits under 1 percent of light at 300 nanometers and only starts letting ultraviolet through above roughly 320. The cutoff lands almost exactly on top of the band you need. A single pane 3 millimeters thick is enough; double glazing and low-emissivity coatings only make it more complete.

Glass blocks UVB and passes UVA

Sunlight at the surface is roughly 52 percent infrared, 43 percent visible light and 5 percent ultraviolet, and UVB is a fraction of that 5 percent, well under 1 percent of the total. Glass removes that sliver and lets most of the rest through. Clear single-pane glass passes something like 60 to 75 percent of UVA (315 to 400 nanometers) along with nearly all the visible light and the near-infrared that carries the sun's heat.

So the sunbeam on your desk is real light. It is just missing the one band your skin uses for this job.

What you do get through a window

Infrared is what makes the spot feel warm. Near-infrared is absorbed by cytochrome c oxidase in your mitochondria and supports energy production, and it passes through glass largely intact.

UVA passes too, and it is not inert. UVA photolyzes nitrate stores in the skin and releases nitric oxide, which dilates blood vessels and lowers blood pressure (Liu 2014). It causes immediate pigment darkening, the quick tan that fades within days. And it drives photoaging: the well-known case of a truck driver whose left side of the face was decades older than his right came from 28 years of UVA through a side window (Gordon 2012). That is UVA doing its work with zero UVB alongside it, and zero vitamin D.

Visible light passes, so the melanopsin signal to your suprachiasmatic nucleus is present indoors. It is simply weak. A seat by a window typically receives a few hundred to a few thousand lux; outdoors under an overcast sky you get 10,000 lux and up, and in direct sun 50,000 to 100,000. The glass is not the main loss here. Distance from the opening and the narrow patch of sky you can see are.

Car windows

Every car window blocks UVB. The differences are all in UVA. Windshields are laminated with a plastic interlayer that absorbs UVA as well, blocking about 96 percent of it on average. Side and rear windows are tempered glass without that layer; a 2016 survey of 29 cars found side windows blocked anywhere from 44 to 96 percent of UVA depending on the vehicle (Boxer Wachler 2016).

That is why drivers accumulate more sun damage on the window-side arm and face while never making a unit of vitamin D behind the wheel. If you have lupus, a photosensitive condition, or take a photosensitizing medication such as doxycycline, side-window UVA on a long daily drive is enough to matter, and UV-blocking film on the side glass is the fix.

Sunrooms, conservatories and screens

A sunroom is a room with more windows, and the same rule applies. Glass roofs block UVB. Polycarbonate and standard acrylic panels block UVB and most UVA as well. A greenhouse-bright conservatory in July delivers heat, visible light and some UVA, and no vitamin D.

An insect screen is different. Fibreglass mesh does not filter by wavelength; it shades roughly a third of the light and lets the rest, UVB included, pass straight through. Air filters nothing.

Open the window

An open window works, with two conditions. First, the sun has to be high enough. UVB only becomes usable once the sun passes roughly 30 degrees above the horizon, because at lower angles its path through the ozone layer is long enough to strip the band out before it arrives. Your shadow tells you: shorter than your height and the sun is above 45 degrees, well inside the window. At mid-latitudes that means late morning to early afternoon in the warmer months, and not at all for a stretch of winter above about 37 degrees north, whatever you open.

Second, sit at the opening, not across the room. About half of midday UVB arrives as scattered light from the whole sky rather than from the solar disk, so the amount you receive scales with how much sky you can see. Lean out and you see a wide slice of it; three metres back you see a sliver.

How long to stay depends on your skin type, the sun's height and how much skin you expose; the same rules as outdoors, explained in How Much Sun Do You Need for Vitamin D?. Forearms and face through an open window are a small surface. If a balcony or doorway lets you expose arms and legs, use it instead.

Estimate your vitamin D from a sun session →

What to do

  • Stop counting indoor sunbeams toward vitamin D, however warm they feel.
  • When your shadow is shorter than you are, open the window or step outside for 10 to 20 minutes with as much skin exposed as the situation allows; darker skin needs three to six times longer at the same sun.
  • If you cannot get out in that window, treat the day as a no-UVB day and look at food or a supplement rather than the glass.
  • Use the window for what it does deliver: morning brightness for your clock, and warmth. Sit closer, or open it, to raise the lux.

The through line

A window shows you the sun and hides the part of it your skin was built to use. That is not a flaw in the glass, and not a reason to fear a sunny office. It is a reminder that light is a spectrum and each band does its own job. The UVB that makes vitamin D is the narrowest and most fragile band of all, and the only way to receive it is to put skin under open sky.