Look up on a clear day and the sky is blue. It is one of the first questions every child asks, and one of the oldest questions in science. The answer is not that the sky reflects the oceans, and it is not that the air itself is blue. The blue comes from the way sunlight bounces off the air itself.

Sunlight is not really white

The light of the Sun looks white to our eyes, but it is really a mixture of all the colours of the rainbow. You can see this for yourself when sunlight passes through a prism, or when rain turns sunlight into a rainbow. Each colour is light with a different wavelength. Red light has the longest waves we can see, about 750 nanometres. Blue light has much shorter waves, about 400 nanometres. That difference in wavelength is the whole secret of the blue sky.

Rayleigh scattering: small molecules, big effect

As sunlight enters the atmosphere, it meets the tiny molecules of nitrogen and oxygen that make up the air. These molecules are far smaller than the wavelength of visible light, and they scatter the light that hits them, throwing it off in all directions. This is called Rayleigh scattering, after the 19th-century physicist Lord Rayleigh, who worked out the mathematics of it.

Rayleigh found that the strength of the scattering depends on the wavelength in a dramatic way: it is inversely proportional to the fourth power of the wavelength. In plain language, shorter waves are scattered far more strongly than longer ones. Blue light, with its short waves, is scattered almost ten times as efficiently as red light. So while most of the red, yellow and green light passes straight through the atmosphere, the blue light is bounced around in every direction — and some of that scattered blue light ends up reaching your eyes, no matter where in the sky you look. That is why the whole sky looks blue.

Then why is the sky not violet?

It is a fair question. Violet light has even shorter waves than blue, so it is scattered even more strongly. Three things save blue. First, there is more blue than violet in sunlight to begin with. Second, some of the violet light is absorbed by the upper atmosphere before it ever reaches our eyes. And third, our eyes are simply more sensitive to blue than to violet. The result of all three is that the scattered light we see is blue, not violet.

Why sunsets turn red

At sunset the same physics runs in reverse. When the Sun sits low on the horizon, its light must travel through far more atmosphere to reach you than it does at noon. Along that long path, almost all of the blue light is scattered away before it arrives. What is left is the light that was barely scattered at all: the reds and yellows, which pass straight through to your eyes. Dust, smoke and pollution in the air scatter even more blue light, which is why the reddest sunsets often follow volcanic eruptions or hazy summer days.

The same effect explains why the sky near the horizon looks paler than the deep blue overhead, even at midday. Light from near the horizon has passed through more air, and the blue has been scattered and re-scattered so many times that the colours mix back together into a pale, whitish blue.

Why clouds are white

Clouds are made of water droplets, and those droplets are much larger than the wavelengths of visible light. Instead of scattering blue more than red, they scatter every colour about equally — a different process, called Mie scattering. All the colours mixed together look white, which is why clouds are white, and why fog and snow are white too.

The sky on Mars does the opposite

Other planets tell the same story in reverse. Mars has a very thin atmosphere, made mostly of carbon dioxide and filled with fine dust. That dust scatters light differently from Earth's air molecules. Photographs from NASA's rovers and landers show that the Martian sky is orange or reddish during the day — and at sunset, the sky around the Sun turns a blue-grey colour. It is the exact opposite of Earth, and it is caused by exactly the same kind of physics.

Why it matters

The blue sky is more than a pretty sight. The same scattering that colours our sky is one of the tools scientists use to study the atmospheres of distant planets: by watching how starlight is scattered as it passes through an alien atmosphere, they can work out what that atmosphere is made of. Every time you look up at a blue sky, you are watching the physics that lets us read the skies of other worlds.