The sky is blue because the nitrogen and oxygen molecules in air are far smaller than a wavelength of light, and particles that small scatter light with a strength proportional to one over the wavelength to the fourth power. Blue light at 450 nm is scattered about 5.9 times more strongly than red light at 700 nm, so blue arrives from every direction. At sunset the direct beam crosses up to about 38 times more air, the blue is scattered out of it, and what reaches you is orange and red.
That effect is called Rayleigh scattering, after the British physicist John William Strutt, Lord Rayleigh, whose theory of scattering was published in 1871 and was the first correct explanation of the blue sky, according to the MacTutor history archive at the University of St Andrews. His Nobel Prize in Physics in 1904 was for something else: the densities of gases and the discovery of argon.
This post goes one level deeper than our tour of the electromagnetic spectrum. It pairs with the Stefan Boltzmann law and blackbody radiation, because the colour of sunlight before it enters the air comes from the Sun's blackbody spectrum, and with how fibre optic cables are made, because the same physics sets the loss floor of glass fibre.
A note on numbers. Constants come from NIST's CODATA tables; the air density, molecular weight and King factor from Bodhaine and colleagues (1999); the air mass formula from PVEducation; the eye's response from the CIE 1924 table at University College London's Colour and Vision Research Laboratory; and the Sun's temperature from NASA. Inputs we chose ourselves are labelled illustrative, and the Python script in the walkthrough reproduces every number.
Key takeaways
- The rule: particles much smaller than the wavelength (size parameter x = 2πr/λ much less than 1) scatter with intensity proportional to λ⁻⁴. Air molecules, at roughly 0.3 nm across, sit about three orders of magnitude inside that regime for visible light.
- The origin of the fourth power: light drives the molecule's electrons into an oscillating dipole, and an oscillating dipole radiates power proportional to the fourth power of its frequency. Frequency is c/λ, so the power goes as λ⁻⁴.
- Blue versus red: (700/450)⁴ ≈ 5.86. Violet at 400 nm is scattered about 9.4 times more than red at 700 nm.
- How much scattering in total: the Rayleigh optical depth of the whole atmosphere at sea level is about 0.097 at 550 nm and 0.22 at 450 nm, which means about 80 percent of 450 nm light in an overhead beam gets through without being scattered.
- Sunsets: at a zenith angle of 85 degrees (sun 5 degrees above the horizon) the beam crosses about 10.3 air masses. Molecular scattering alone leaves about 10 percent of the 450 nm light and 69 percent of the 700 nm light, a red to blue ratio near 6.7 before dust and haze add their share.
- Why not violet: the Sun emits less violet than blue, and the eye's brightness response at 400 nm is about one hundredth of its response at 450 nm.
- When Rayleigh stops working: cloud droplets and haze are comparable to or larger than the wavelength, fall in the Mie regime and look white.
- In engineering: it sets the short wavelength loss floor of glass fibre and gives lidar its clear air signal.
What is Rayleigh scattering, who described it, and when does it apply?
Rayleigh scattering is the elastic scattering of light by particles much smaller than the wavelength. Elastic means the scattered light keeps its original wavelength: the molecule redirects the light but does not change its colour, which is what separates it from Raman scattering, where the scattered photon gains or loses the energy of a molecular vibration. Georgia State University's HyperPhysics reference describes Rayleigh scattering as scattering from the molecules of the air that "can be extended" to particles up to about a tenth of the wavelength.
NASA's Space Place puts the everyday version simply: sunlight is scattered in all directions by the gases and particles in the air, and blue is scattered more than other colours because it travels as shorter waves. The National Weather Service office in Flagstaff gives the same picture and adds the two corrections we work through below: the sky looks blue rather than violet because our eyes are more sensitive to blue and the Sun emits more blue than violet, and the sky near the horizon is paler because the scattered light has to cross more air to reach you.
John William Strutt, Lord Rayleigh
John William Strutt was born on 12 November 1842 at Langford Grove, Maldon, Essex, and died on 30 June 1919, according to the Nobel Foundation's facts page. He did experimental work at his family's estate in Terling, and the MacTutor biography records that his theory of scattering, published in 1871, "was the first correct explanation of why the sky is blue." The same biography lists the long range of his other work: acoustics and his treatise on sound, the determination of the ohm, the resolving power of prisms and gratings, and the whispering gallery problem.
The 1904 Nobel Prize in Physics went to Rayleigh "for his investigations of the densities of the most important gases and for his discovery of argon in connection with these studies", in the Nobel Foundation's wording. It is common to read that he won the Nobel for explaining the blue sky. He did not. The scattering work is older and, in its consequences, at least as famous, but the prize citation is about gas densities and argon.
Timeline: from the 1871 paper to lidar in orbit
| Year | Event | Source |
|---|---|---|
| 1842 | John William Strutt born, 12 November, Maldon, Essex | Nobel Foundation facts page |
| 1871 | Rayleigh publishes his theory of light scattering by small particles, the first correct explanation of the blue sky | MacTutor, University of St Andrews |
| 1904 | Nobel Prize in Physics to Rayleigh for gas densities and the discovery of argon | Nobel Foundation |
| 1919 | Rayleigh dies, 30 June | Nobel Foundation facts page |
| 1966 | Charles Kao's analysis shows fibre loss is set by absorption and scattering, and that impurities, not glass itself, cause the measured losses | Nobel Prize in Physics 2009, scientific background |
| 1970 | A US research team reports fused silica fibre with the low losses Kao envisioned (Applied Physics Letters 17, 423) | Nobel Prize in Physics 2009, scientific background |
| 1991 | Mount Pinatubo eruption injects more than 20 million tons of sulfur dioxide as high as 60 km, forming stratospheric sulfate aerosol | NASA Earth Observatory |
| 2006 | CALIPSO, a satellite carrying a multi wavelength backscatter lidar, launches on 28 April | NASA |
| 2009 | Half of the Nobel Prize in Physics to Charles Kao for the transmission of light in fibres | Nobel Foundation |
When does the Rayleigh approximation apply?
Physicists judge the regime with the size parameter, a dimensionless number that compares the particle's circumference with the wavelength:
x = 2 * pi * r / lambda
r particle radius (m)
lambda wavelength of light (m)
x much less than 1 -> Rayleigh regime, scattering ~ lambda^-4
x near 1 to ~50 -> Mie regime, full solution needed
x much greater -> geometric optics (refraction, reflection, rainbows)
For a nitrogen molecule about 0.3 nm across (radius about 0.15 nm, an illustrative round figure) and green light at 550 nm, x ≈ 0.0017. That is deep inside the Rayleigh regime. For a 10 µm cloud droplet radius (illustrative but typical), x ≈ 114, far outside it.
Why does scattered intensity scale with one over wavelength to the fourth power?
There are two ways to see the fourth power: a physical one from dipole radiation and a quick one from dimensional analysis. Both give the same answer.
The dipole argument
A light wave is an oscillating electric field. When it passes over a molecule, it pushes the electron cloud one way and the nuclei the other, inducing an electric dipole moment p that oscillates at the same frequency as the light. The size of that dipole depends on the molecule's polarizability α:
p(t) = alpha * E0 * cos(omega * t)
alpha polarizability (C m^2 / V)
E0 amplitude of the incoming field (V/m)
omega angular frequency of the light (rad/s), omega = 2 * pi * c / lambda
An oscillating dipole is a tiny antenna. Classical electrodynamics gives its time averaged radiated power as:
P = p0^2 * omega^4 / (12 * pi * epsilon0 * c^3)
p0 = alpha * E0 (dipole amplitude)
The key factor is omega to the fourth. The radiated field is proportional to the acceleration of the charges, which brings in omega squared, and power goes as the field squared, which doubles it to omega to the fourth. Since omega = 2πc/λ, the power is proportional to λ⁻⁴. Halve the wavelength and the scattered power rises sixteen times.
The polarizability of air molecules changes only slightly across the visible band, because their electronic resonances lie far out in the ultraviolet. That is why the λ⁻⁴ law holds well for air in visible light. It also tells you where the law will bend: approaching the ultraviolet resonances, polarizability rises and scattering climbs a little faster than λ⁻⁴. The Bodhaine paper discusses exactly this when it notes that simple power law fits for Rayleigh optical depth "cannot be extrapolated" into the ultraviolet, where the effective exponent changes.
The dimensional argument
The scattered field must grow with particle volume V (the dipole grows with the amount of material) and fall as 1/R with distance. The ratio of scattered to incident field is dimensionless, so the leftover length squared can only come from the wavelength:
E_scattered / E0 ~ V / (R * lambda^2)
I_scattered / I0 ~ V^2 / (R^2 * lambda^4)
Same λ⁻⁴, plus a bonus: intensity grows as volume squared, the sixth power of radius. Double a small particle's size and it scatters 64 times more, which is why a little haze can overwhelm molecular scattering.
The full formula and the angular pattern
For a small sphere of diameter d and refractive index n, HyperPhysics gives Rayleigh's scattered intensity at angle θ and distance R as:
I = I0 * (1 + cos^2(theta)) / (2 * R^2) * (2*pi/lambda)^4 * ((n^2 - 1)/(n^2 + 2))^2 * (d/2)^6
The (1 + cos²θ) factor describes the angular pattern for unpolarized sunlight. Scattering is equally strong forward and backward and half as strong at 90 degrees. Light scattered at 90 degrees is also strongly polarized, which is why polarizing sunglasses or a camera polarizer darken a band of sky about 90 degrees from the Sun.
For a gas such as air, the per molecule cross section is the more useful quantity. Bodhaine and colleagues recommend this form, where Ns is the molecular number density and F is a correction for the fact that real molecules are not perfect spheres:
sigma(lambda) = (24 * pi^3 / (lambda^4 * Ns^2)) * ((n^2 - 1)/(n^2 + 2))^2 * F
sigma scattering cross section per molecule (m^2)
n refractive index of air at lambda
Ns molecules per m^3 at the same conditions as n
F King factor = (6 + 3*rho) / (6 - 7*rho), rho = depolarization ratio
The paper calls F the King factor and states that it "is the least known" input and is responsible for most of the uncertainty. Following Young (1981), as the paper reports, F(air) = 1.0480. The molecular density of standard air at 288.15 K and 1013.25 hPa is 2.546899 × 10¹⁹ molecules per cm³, or 2.546899 × 10²⁵ per m³.
Worked example 1: how much more is 450 nm blue scattered than 700 nm red?
Start with the ratio alone. Because the scattered power goes as λ⁻⁴ and everything else (the molecule, the distance, the angle) is the same, the ratio of scattering at two wavelengths is the inverse ratio of the wavelengths raised to the fourth power.
S(450 nm) / S(700 nm) = (700 nm / 450 nm)^4
= (1.5556)^4
= 5.86 (dimensionless)
The units cancel, which is a useful check: a ratio of two wavelengths in the same unit is a pure number.
Some other pairs, all from the same formula:
| Pair | Ratio of wavelengths | Ratio of scattering |
|---|---|---|
| 450 nm blue vs 700 nm red | 1.556 | 5.86 |
| 400 nm violet vs 700 nm red | 1.750 | 9.38 |
| 450 nm blue vs 550 nm green | 1.222 | 2.23 |
| 400 nm violet vs 450 nm blue | 1.125 | 1.60 |
So blue is scattered several times more than red, not thousands of times, which is why the sky is a pale blue: the longer wavelengths are scattered too, just less. Violet beats blue by a further factor of 1.6; worked example 3 explains why the sky still does not look violet.
Worked example 1b: the absolute cross section and the optical depth at 550 nm
The ratio tells you which colour wins. The absolute numbers tell you how much light is lost overall. This calculation takes four inputs.
Refractive index of air. Bodhaine and colleagues recommend the Peck and Reeder (1972) dispersion formula for standard air, which gives n − 1 = 2.778 × 10⁻⁴ at 550 nm. As a cross check, NIST's Engineering Metrology Toolbox publishes a simple shop floor formula for 633 nm, quoted to an expanded uncertainty of 1.5 × 10⁻⁷. For 101.325 kPa, 15 °C and dry air it gives 2.765 × 10⁻⁴, the same value Peck and Reeder give at 633 nm.
Molecular density. Ns = 2.546899 × 10²⁵ m⁻³ at 288.15 K and 1013.25 hPa (Bodhaine). You can check it from the ideal gas law with NIST's exact Boltzmann constant, k = 1.380649 × 10⁻²³ J/K: 101325 / (1.380649 × 10⁻²³ × 288.15) = 2.5469 × 10²⁵ m⁻³.
King factor. F = 1.0480.
Wavelength. λ = 550 × 10⁻⁹ m.
Plugging in:
n^2 - 1 = (1.0002778)^2 - 1 = 5.557e-4
n^2 + 2 = 3.0005557
((n^2-1)/(n^2+2))^2 = (1.852e-4)^2 = 3.430e-8
lambda^4 = (550e-9 m)^4 = 9.151e-26 m^4
Ns^2 = (2.546899e25)^2 = 6.487e50 m^-6
24 * pi^3 = 744.15
sigma = 744.15 / (9.151e-26 * 6.487e50) * 3.430e-8 * 1.0480
= 4.51e-31 m^2 per molecule
That is a tiny area, about 4.5 × 10⁻²⁷ cm². A single molecule is almost transparent. The sky is bright only because there are so many molecules.
How many molecules are overhead? Surface pressure is the weight of the air column per unit area, so the number of molecules per square metre above you is the pressure times Avogadro's number divided by the mass of one mole of air times gravity. Bodhaine gives the mean molecular weight of dry air with 360 ppm of carbon dioxide as 28.9649 g/mol. NIST gives the Avogadro constant as exactly 6.02214076 × 10²³ per mole. With standard gravity of 9.80665 m/s²:
N_column = P * N_A / (m_a * g)
= 101325 Pa * 6.02214076e23 mol^-1 / (0.0289649 kg/mol * 9.80665 m/s^2)
= 2.148e29 molecules per m^2
Optical depth. Multiply the cross section by the column:
tau(550 nm) = sigma * N_column
= 4.51e-31 m^2 * 2.148e29 m^-2
= 0.097 (dimensionless)
An optical depth of 0.097 means the direct beam from an overhead sun keeps exp(−0.097) ≈ 91 percent of its 550 nm light. The other 9 percent is not lost to heat. It is scattered, and a large share of that scattered light comes down to the ground as skylight.
Repeating the calculation across the visible band gives this table, which the rest of the post uses:
| Wavelength | n − 1 (standard air) | Cross section σ (m²) | Rayleigh optical depth τ | Overhead transmission exp(−τ) |
|---|---|---|---|---|
| 400 nm | 2.828 × 10⁻⁴ | 1.67 × 10⁻³⁰ | 0.358 | 0.70 |
| 450 nm | 2.805 × 10⁻⁴ | 1.03 × 10⁻³⁰ | 0.220 | 0.80 |
| 500 nm | 2.790 × 10⁻⁴ | 6.65 × 10⁻³¹ | 0.143 | 0.87 |
| 550 nm | 2.778 × 10⁻⁴ | 4.51 × 10⁻³¹ | 0.097 | 0.91 |
| 600 nm | 2.770 × 10⁻⁴ | 3.16 × 10⁻³¹ | 0.068 | 0.93 |
| 700 nm | 2.758 × 10⁻⁴ | 1.69 × 10⁻³¹ | 0.036 | 0.96 |
Notice that the ratio of optical depths from 450 to 700 nm is 0.220 / 0.036 ≈ 6.0, a little more than the pure λ⁻⁴ ratio of 5.86. The difference is the small rise in the refractive index toward short wavelengths. It is the same bend Bodhaine describes, where the effective exponent is a little steeper than 4. The paper also notes that the Rayleigh optical depth reaches "the order of 1" at 300 nm, which our formula reproduces if you extend it there.
Worked example 2: why are sunsets red? Path length and air mass
At noon the Sun's light crosses the atmosphere by the shortest route. At sunset it crosses it almost sideways, through much more air. The standard way to measure this is the air mass: the path length through the atmosphere divided by the overhead path length. PVEducation defines it and gives the simple flat atmosphere version:
AM = 1 / cos(z) z = zenith angle (0 deg = sun overhead)
That flat formula fails near the horizon. At z = 90 degrees it goes to infinity, while the real path, along a curved atmosphere, stays finite. PVEducation gives the curved Earth correction from Kasten and Young (1989), which we use here:
AM = 1 / (cos(z) + 0.50572 * (96.07995 - z)^(-1.6364)) z in degrees
The transmitted fraction of the direct beam then follows the Beer Lambert law: each layer removes a fixed fraction, so the total transmission is exponential in the optical depth times the air mass.
T(lambda, z) = exp( -tau(lambda) * AM(z) )
Using τ(450 nm) = 0.220 and τ(700 nm) = 0.036 from the table above:
| Zenith angle z | Sun's elevation | Air mass (Kasten and Young) | T at 450 nm | T at 700 nm | Red to blue ratio in the beam |
|---|---|---|---|---|---|
| 0° | 90° | 1.00 | 0.80 | 0.96 | 1.20 |
| 30° | 60° | 1.15 | 0.78 | 0.96 | 1.24 |
| 60° | 30° | 1.99 | 0.64 | 0.93 | 1.44 |
| 75° | 15° | 3.81 | 0.43 | 0.87 | 2.02 |
| 80° | 10° | 5.59 | 0.29 | 0.82 | 2.79 |
| 85° | 5° | 10.31 | 0.10 | 0.69 | 6.65 |
| 88° | 2° | 19.43 | 0.014 | 0.49 | 35.7 |
| 90° | 0° | 37.92 | 0.0002 | 0.25 | about 1,070 |
Read the 85 degree row as a worked example. With the Sun five degrees above the horizon, the beam crosses 10.31 air masses. The 450 nm transmission is exp(−0.220 × 10.31) = exp(−2.27) ≈ 0.10. The 700 nm transmission is exp(−0.036 × 10.31) = exp(−0.375) ≈ 0.69. Only one tenth of the blue survives but more than two thirds of the red does, so the direct sunlight has been reddened by a factor of about 6.7 relative to noon, before any dust or smoke is counted.
At the horizon the numbers become extreme. The blue transmission falls to about 2 parts in 10,000, while a quarter of the red still gets through. The setting Sun has almost no blue left in it.
This is molecular scattering only, in perfectly clean, dry air at sea level. Real sunsets add three more effects:
- Aerosols. Haze, dust, smoke and sea salt add their own extinction. NOAA's Global Monitoring Laboratory describes aerosol optical depth of 0.01 as an extremely clean atmosphere and 0.4 as very hazy, with a typical average for the United States of 0.1 to 0.15. Multiply that by an air mass of 10 to 38 and aerosols can remove as much light as the molecules do.
- Volcanic sulfate. After the 1991 Pinatubo eruption, NASA Earth Observatory reports, sulfate aerosol formed in the stratosphere. NWS Flagstaff notes that after a major eruption the most spectacular sunrises and sunsets can occur, because more particles mean more scattering of the remaining short wavelengths.
- Clouds. Lit from below by the reddened beam, clouds scatter all colours almost equally (the Mie regime, below), so they glow orange, pink and red.
Why the sky near the horizon is pale, and why it is darker at altitude
Toward the horizon you look through more air, and NASA Space Place and NWS Flagstaff both explain that the scattered blue is itself scattered again many times, mixing the colours back toward white. Up a mountain the opposite happens: with less air overhead, NWS Flagstaff notes, the sky turns very dark blue or even bluish violet, and space is black because almost nothing is left to scatter. Bodhaine's method makes the scaling explicit: the molecular column depends only on pressure, so at 3,000 metres, where pressure is roughly 70 percent of sea level, the overhead Rayleigh optical depth is roughly 70 percent too.
Worked example 3: why is the sky not violet?
If scattering always favours shorter wavelengths, and violet is shorter than blue, why is the sky not violet? NWS Flagstaff gives the two reasons in one sentence: our eyes are more sensitive to blue light, and the Sun emits more energy as blue light than as violet. We can put numbers on both.
Step 1: the light that goes in
Approximate the Sun as a blackbody at its effective temperature of 5,772 K, the value on NASA's Sun fact sheet. Planck's law gives the spectral radiance:
B(lambda, T) = (2 * h * c^2 / lambda^5) / (exp(h * c / (lambda * k * T)) - 1)
h = 6.62607015e-34 J s (exact, SI)
c = 299792458 m/s (exact, SI)
k = 1.380649e-23 J/K (exact, SI)
T = 5772 K
Relative to 450 nm, a 5,772 K blackbody emits 0.90 times as much at 400 nm, 1.01 times as much at 550 nm and 0.81 times as much at 700 nm, per nanometre of wavelength. The real solar spectrum is not a perfect blackbody. And NASA Earth Observatory notes that stratospheric ozone, between about 10 and 40 km up, shields the surface from the Sun's ultraviolet. Shortwave losses like these mean the blackbody, if anything, overstates how much violet arrives.
Step 2: scattering
Multiply by λ⁻⁴ to get the spectrum of the scattered skylight, relative to 450 nm:
| Wavelength | Sunlight (blackbody, relative to 450 nm) | Skylight after λ⁻⁴ (relative to 450 nm) | CIE 1924 photopic V(λ) | Skylight times V(λ) (relative to 450 nm) |
|---|---|---|---|---|
| 400 nm | 0.90 | 1.44 | 0.000396 | 0.015 |
| 420 nm | 0.95 | 1.25 | 0.0040 | 0.13 |
| 450 nm | 1.00 | 1.00 | 0.038 | 1.00 |
| 470 nm | 1.02 | 0.86 | 0.091 | 2.05 |
| 500 nm | 1.03 | 0.68 | 0.323 | 5.75 |
| 550 nm | 1.01 | 0.45 | 0.995 | 11.9 |
| 600 nm | 0.96 | 0.30 | 0.631 | 5.04 |
| 650 nm | 0.89 | 0.20 | 0.107 | 0.58 |
| 700 nm | 0.81 | 0.14 | 0.0041 | 0.015 |
The skylight column shows that there is physically more violet energy in the sky than blue, per nanometre: 1.44 versus 1.00. Scattering alone would push the sky toward violet.
Step 3: the eye
The CIE 1924 photopic luminosity function V(λ), the international standard for how bright the daylight adapted eye judges each wavelength, peaks at 555 nm with a value of 1. At 450 nm it is 0.038. At 400 nm it is 0.000396, about one hundredth of its value at 450 nm. The last column shows that, weighted by brightness, the 400 nm skylight contributes about 1.5 percent of what 450 nm contributes. Violet is in the sky, but the eye barely registers it.
One subtlety: V(λ) measures brightness, not hue. Most of the sky's brightness comes from the middle of the spectrum, but hue is set by the ratio of signals in the three cone types, and compared with sunlight the skylight spectrum is tilted toward short wavelengths. The cones read that broad, tilted spectrum as a pale, desaturated blue.
So scattering alone does not settle the sky's colour: less violet arrives from the Sun, and the eye is far less sensitive to violet than to blue. The source and the observer are part of the answer.
How does Rayleigh scattering differ from Mie scattering?
Rayleigh's formula is a limit. When particles grow to a sizeable fraction of the wavelength, the different parts of the particle no longer feel the same field at the same moment, waves scattered from different parts interfere, and the simple dipole picture fails. The exact solution for a sphere of any size is called Mie theory, after Gustav Mie. It is a series solution of Maxwell's equations and gives the scattering, absorption and angular pattern for any size parameter and refractive index.
HyperPhysics summarises the practical differences. Mie scattering "is not strongly wavelength dependent", it produces the almost white glare around the Sun when there are many particles in the air, and it gives the white light of mist and fog. It also has a strong forward lobe, so large particles throw most of their scattered light in roughly the same direction as the incoming beam, and the lobe gets sharper and more intense as the particles grow.
Clouds: why they are white
Cloud droplets are typically several micrometres to a few tens of micrometres across. For a 10 µm radius droplet (illustrative), the size parameter at 550 nm is x ≈ 114, and at 450 nm and 700 nm it is still 140 and 90. In that regime, scattering efficiency is nearly the same for every visible wavelength, so a cloud returns sunlight with roughly the colour it came in with: white. HyperPhysics notes that cloud droplets are much larger than air molecules and that their scattering is almost independent of wavelength in the visible range.
Haze, aerosols and white skies
NASA Earth Observatory describes aerosols as tiny airborne solid and liquid particles ranging from a few nanometres to several tens of micrometres, the range between the smallest viruses and a human hair. Air quality agencies classify them by size as PM2.5 and PM10. The smallest aerosols, tens of nanometres across, are close to the Rayleigh regime and scatter blue preferentially. Particles of a few hundred nanometres sit right in the Mie regime, where scattering per particle is very efficient and only weakly dependent on colour.
That is why a hazy or polluted day gives a white or milky sky. The molecules are still scattering blue as usual, but the aerosols add a large amount of nearly colourless scattered light on top of it, diluting the blue. The same goes for the bright white zone around the Sun on a hazy day: that is the forward lobe of Mie scattering.
Mars: the reverse sky
NASA's Space Place gives a vivid counterexample. Mars has a very thin carbon dioxide atmosphere full of fine dust. In photos from NASA's Mars Pathfinder lander, the daytime sky is orange or reddish, and at sunset the sky around the Sun turns blue grey. Space Place explains that the fine dust scatters light differently from the gases in Earth's air: with very little molecular scattering in thin air, the dust sets the colours.
Table: scatterer size, regime and everyday example
All size parameters below are for 550 nm light. Sizes are illustrative round figures within the ranges described by the cited sources.
| Scatterer | Typical size | Size parameter x at 550 nm | Regime | Wavelength dependence | Everyday example |
|---|---|---|---|---|---|
| Nitrogen or oxygen molecule | about 0.3 nm | 0.0017 | Rayleigh | Strong, λ⁻⁴ | Blue sky, red sunset |
| Fine aerosol | 50 nm radius | 0.57 | Rayleigh to Mie transition | Weaker than λ⁻⁴ | Bluish smoke from a wood fire seen against a dark background |
| Haze particle | 0.25 µm radius | 2.9 | Mie | Weak | Milky white sky on a humid or polluted day |
| Cloud droplet | 10 µm radius | 114 | Mie (near geometric) | Almost none | White clouds, fog, mist |
| Raindrop | 1 mm radius | 11,400 | Geometric optics | From refraction and dispersion, not scattering | Rainbows |
| Martian dust | about 1 µm | about 10 | Mie, with absorption | Particle dependent | Orange Martian day sky, blue Martian sunset |
Where does Rayleigh scattering show up in engineering?
Optical fibre: the loss floor of glass
Glass is a frozen liquid, and its density fluctuates on a scale of nanometres, far smaller than the wavelength of light. Each fluctuation acts like a small scatterer, so silica glass has its own Rayleigh scattering, with the same λ⁻⁴ dependence. The Nobel Foundation's scientific background for the 2009 Nobel Prize in Physics shows the attenuation of silica as a function of wavelength: on the short wavelength side, it says, attenuation is due to Rayleigh scattering, which varies as λ⁻⁴, while on the long wavelength side it is due to absorption by molecules.
That shape is why long distance fibre runs near 1.55 µm. According to the same document, the first optical fibres lost about 1,000 dB/km. Charles Kao concluded in 1966 that losses in pure glass are set mostly by absorption and scattering and that the measured losses were caused by impurities, especially iron ions. He set 20 dB/km as the threshold for useful communication. A US team made fused silica fibre with the low losses he had envisioned in 1970, reached 4 dB/km at 850 nm a few years later, then went below 1 dB/km, and today attenuation at 1.55 µm is below 0.2 dB/km. The document adds that a modern fibre leaves more than 95 percent of the light after 1 km.
Worked example 4: decibels, transmission and the λ⁻⁴ penalty in fibre
Decibels convert to a power fraction with T = 10^(−L/10), where L is the loss in dB.
Early fibre: 1000 dB/km over 20 m (0.020 km)
L = 1000 dB/km * 0.020 km = 20 dB
T = 10^(-20/10) = 0.01 -> 1 percent transmitted
Modern fibre at 1.55 um: 0.2 dB/km over 1 km
L = 0.2 dB
T = 10^(-0.02) = 0.955 -> about 95 percent transmitted
Modern fibre over an 80 km span (illustrative span length)
L = 0.2 dB/km * 80 km = 16 dB
T = 10^(-1.6) = 0.025 -> about 2.5 percent transmitted
The first two lines reproduce the Nobel document's own figures: 1 percent after 20 metres of early fibre, and more than 95 percent after 1 km of modern fibre. The third shows why long links need amplifiers every several tens of kilometres.
Now the λ⁻⁴ penalty. If Rayleigh scattering in the glass is a loss A at 1,550 nm, the same glass at other common windows has:
Rayleigh loss at 1310 nm = A * (1550/1310)^4 = 1.96 * A
Rayleigh loss at 850 nm = A * (1550/850)^4 = 11.1 * A
Moving from 1,550 nm to 850 nm multiplies the scattering floor by about eleven. Short wavelength multimode links at 850 nm are fine over a few hundred metres in a building, but long haul systems sit near 1,550 nm where scattering is low and the long wavelength absorption has not yet started.
Lidar: scattering as the signal
A lidar fires laser pulses and times the light scattered back. In clean air, the molecular backscatter that lidar receives is Rayleigh scattering, and its strength depends on wavelength in the usual way. NASA describes CALIPSO, launched on 28 April 2006 with the CloudSat radar, as carrying a multi wavelength backscatter lidar, an imaging infrared radiometer and a visible camera, and records that it built long term records of the vertical structure of volcanic stratospheric aerosols and polar stratospheric clouds.
Worked example: suppose a lidar uses the doubled and fundamental lines of a common solid state laser, 532 nm and 1,064 nm (illustrative choice). The molecular backscatter ratio between them is:
beta_mol(532) / beta_mol(1064) = (1064/532)^4 = 2^4 = 16
The 532 nm channel sees sixteen times more molecular signal from the same air. Aerosols and clouds, being larger, scatter much more evenly across the two wavelengths. Comparing channels therefore helps separate molecules from particles, and the known molecular signal in particle free layers is used to calibrate the instrument.
Remote sensing: subtracting the sky
Every satellite image of the ground passes through the atmosphere twice, and Rayleigh scattering adds a blue haze of path radiance on top of the surface signal. Before you can measure ocean colour, vegetation or aerosols from space, you subtract the molecular part. Bodhaine and colleagues explain why the precision matters: where Rayleigh optical depth is around 1, at 300 nm, a 0.1 percent error in it becomes a 10 percent error in a derived aerosol optical depth.
Walkthrough: reproduce every number in Python
Every figure in this post came from a short script. It uses only the Python standard library for the calculations. If you want to go further into Mie scattering, the open source miepython package on PyPI, version 3.3.0 at the time of writing, describes itself as computing "Mie scattering of a plane wave by a sphere."
Step 1: create a clean, pinned environment
mkdir rayleigh-check && cd rayleigh-check
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
# Optional, only if you want arrays, plots or Mie calculations
python -m pip install "numpy==2.5.4" "miepython==3.3.0"
python -m pip freeze > requirements.txt
Pinning exact versions means the script gives the same answer next year, and freezing them into requirements.txt records exactly what you installed. Check the current versions on PyPI before pinning; ours were the latest on 25 October 2026.
Step 2: write the calculations
# rayleigh.py
import math
h = 6.62607015e-34 # J s, exact (SI)
c = 299792458.0 # m/s, exact (SI)
k = 1.380649e-23 # J/K, exact (SI)
NA = 6.02214076e23 # 1/mol, exact (SI)
Ns = 2.546899e25 # molecules/m^3, 288.15 K, 1013.25 hPa (Bodhaine 1999)
F_KING = 1.0480 # King factor for air (Bodhaine 1999, after Young 1981)
M_AIR = 28.9649e-3 # kg/mol, dry air with 360 ppm CO2 (Bodhaine 1999)
G = 9.80665 # m/s^2, standard gravity
P0 = 101325.0 # Pa
def n_minus_1(lam_um):
"""Refractive index of standard air minus 1 (Peck and Reeder 1972)."""
s2 = 1.0 / lam_um**2
return (8060.51 + 2480990 / (132.274 - s2) + 17455.7 / (39.32957 - s2)) * 1e-8
def sigma(lam_nm):
lam = lam_nm * 1e-9
n = 1 + n_minus_1(lam_nm / 1000)
return 24 * math.pi**3 * (n*n - 1)**2 / (lam**4 * Ns**2 * (n*n + 2)**2) * F_KING
N_COL = P0 * NA / (M_AIR * G)
def tau(lam_nm):
return sigma(lam_nm) * N_COL
def air_mass(z_deg):
"""Kasten and Young (1989)."""
return 1 / (math.cos(math.radians(z_deg)) + 0.50572 * (96.07995 - z_deg) ** -1.6364)
def planck(lam_nm, T=5772):
lam = lam_nm * 1e-9
return 2*h*c*c / lam**5 / (math.exp(h*c / (lam*k*T)) - 1)
print("450 vs 700 ratio: %.2f" % ((700/450)**4))
print("column: %.3e molecules/m^2" % N_COL)
for lam in (400, 450, 500, 550, 600, 700):
print("%d nm sigma=%.3e m^2 tau=%.3f" % (lam, sigma(lam), tau(lam)))
for z in (0, 30, 60, 75, 80, 85, 88, 90):
A = air_mass(z)
tb, tr = math.exp(-tau(450)*A), math.exp(-tau(700)*A)
print("z=%2d AM=%6.2f T450=%.4f T700=%.4f ratio=%.2f" % (z, A, tb, tr, tr/tb))
V = {400: 0.000396, 450: 0.038, 550: 0.99495, 700: 0.004102} # CIE 1924, CVRL
base = planck(450) * 450**-4 * V[450]
for lam in sorted(V):
print("%d nm skylight x V relative to 450 nm: %.4f" % (lam, planck(lam) * lam**-4 * V[lam] / base))
Step 3: run it and compare
python rayleigh.py
You should see:
450 vs 700 ratio: 5.86
column: 2.148e+29 molecules/m^2
400 nm sigma=1.669e-30 m^2 tau=0.358
450 nm sigma=1.025e-30 m^2 tau=0.220
500 nm sigma=6.652e-31 m^2 tau=0.143
550 nm sigma=4.507e-31 m^2 tau=0.097
600 nm sigma=3.163e-31 m^2 tau=0.068
700 nm sigma=1.693e-31 m^2 tau=0.036
z= 0 AM= 1.00 T450=0.8024 T700=0.9643 ratio=1.20
...
z=85 AM= 10.31 T450=0.1033 T700=0.6875 ratio=6.65
...
400 nm skylight x V relative to 450 nm: 0.0150
If your optical depths are about 5 percent too low, you probably left out the King factor. If they are wildly off, check that you converted nanometres to metres before taking the fourth power: (550 × 10⁻⁹)⁴ is 9.15 × 10⁻²⁶ m⁴, and an error in the exponent there changes the answer by many orders of magnitude.
Step 4: keep the script's dependencies healthy
A notebook that plots spectra or a satellite processing chain soon has dozens of dependencies, and they collect vulnerabilities over time. Scan the folder with the Safeguard CLI and read the JSON results it writes under ./output:
safeguard scan --dir .
ls output/
Run it again whenever you add a library, and commit requirements.txt so a colleague who reruns your numbers installs the same versions.
Common mistakes
- Confusing scattering with absorption. Air molecules do not absorb visible blue light and re emit it later. Rayleigh scattering is elastic and essentially instantaneous: the light keeps its wavelength and changes direction. Absorption converts light into heat or chemical energy and removes it. Ozone absorption in the ultraviolet is a separate process from the scattering that colours the sky.
- Applying Rayleigh's formula to cloud droplets. A cloud droplet's size parameter is around 100, far outside the Rayleigh regime. Using λ⁻⁴ for clouds predicts blue clouds. Real clouds are white because they are in the Mie regime.
- Forgetting the eye's response. Scattering alone makes violet stronger than blue. The sky looks blue because of the solar spectrum, ultraviolet absorption by ozone and the eye's low sensitivity at 400 nm. Leave the observer out and the explanation is wrong.
- Saying blue light is "absorbed" at sunset. It is scattered out of the direct beam. That light is not destroyed. It lights up the sky for someone else, often far to the east of you.
- Using AM = 1/cos(z) at the horizon. The flat atmosphere formula goes to infinity at z = 90 degrees. Use the Kasten and Young form, which gives about 38 at the horizon.
- Dropping the sixth power of size. The λ⁻⁴ law gets the attention, but intensity also scales as the sixth power of particle radius. A few slightly larger particles can dominate scattering.
- Treating λ⁻⁴ as exact for air. Because the refractive index rises toward the ultraviolet, the effective exponent for air is a little steeper than 4. For two wavelength ratios in the visible, λ⁻⁴ is fine; for accurate optical depths, use the full cross section.
- Crediting the 1904 Nobel Prize to the blue sky. Rayleigh's prize was for gas densities and argon.
FAQ
Why is the sky blue in simple terms?
Sunlight contains all colours. The molecules in air are much smaller than a wavelength of light, and particles that small scatter short wavelengths much more than long ones, with a strength proportional to one over wavelength to the fourth power. Blue light is scattered about 5.9 times more than red, so it reaches your eyes from every part of the sky.
Why are sunsets red and orange?
At sunset the Sun's light crosses many times more air than at noon, about 10 air masses with the Sun five degrees up and about 38 at the horizon. Most of the blue is scattered out of the direct beam along the way, so the light that reaches you is mostly orange and red. Dust, smoke and volcanic aerosols strengthen the effect.
What is Rayleigh scattering?
It is the elastic scattering of light by particles much smaller than the wavelength, such as gas molecules. The scattered intensity is proportional to λ⁻⁴ and to the square of the particle's volume, and it follows a (1 + cos²θ) angular pattern for unpolarized light. It is named after Lord Rayleigh, who published the theory in 1871.
Why is the sky not purple or violet?
Violet light is scattered even more than blue, but the Sun emits less violet than blue, ozone and the upper atmosphere remove ultraviolet, and the human eye is about one hundred times less sensitive at 400 nm than at 450 nm. The mixture of scattered colours that reaches the eye is perceived as a pale blue.
What is the difference between Rayleigh and Mie scattering?
Rayleigh scattering applies to particles much smaller than the wavelength and depends strongly on wavelength. Mie scattering applies to particles comparable to or larger than the wavelength, such as cloud droplets and haze, depends only weakly on wavelength and is concentrated in the forward direction. Rayleigh gives a blue sky; Mie gives white clouds and a white haze.
Why are clouds white if the sky is blue?
Cloud droplets are about a thousand times larger than air molecules. In that size range, scattering is almost the same for all visible wavelengths, so the cloud scatters sunlight back with the colour it arrived with, which is white. Thick clouds look grey from below because much of the light is scattered back out of the top.
Did Lord Rayleigh win the Nobel Prize for explaining the blue sky?
No. The 1904 Nobel Prize in Physics was awarded to him for his investigations of the densities of the most important gases and for his discovery of argon. His scattering theory dates from 1871.
How does Rayleigh scattering affect fibre optic cables?
Tiny density fluctuations frozen into glass scatter light with the same λ⁻⁴ dependence. That scattering sets the loss floor at short wavelengths, which is one reason long distance fibre operates near 1.55 µm, where modern fibre loses less than 0.2 dB per kilometre.
The software that runs the sensors: an honest bridge
Safeguard does not do physics. Our models are single purpose security models, and nothing in this post was calculated by them; the numbers come from published formulas, published constants and the Python script above. The link to Safeguard is narrower and practical. The tools that measure scattering today are software: lidar processing chains, satellite atmospheric correction code, sun photometer data pipelines, fibre test equipment software and the scientific Python notebooks researchers and engineers use to check results. Those programs pull open source components, numerics, plotting, file formats and networking libraries, and those components need the same dependency hygiene as any other application. That is the part Safeguard covers. It does not analyse instruments, validate radiative transfer models or test a lidar's calibration.
Fix it without waiting for upstream
A satellite processing pipeline or an optics notebook is a thin layer of your own code on top of open source scientific libraries, and every rebuild pulls them again. When one ships a vulnerability, the questions are the usual ones: is a fixed version available, and how fast can you move to it.
Whatever the vulnerability, most of the risk sits in two gaps. The first is the time between a fix being published and that fix actually running in your production builds. The second, and worse, is the time before any fix exists at all, while a maintainer works out a patch and a release schedule. Waiting through both gaps is a habit, not a requirement. Safeguard gives teams three ways to close them.
1. Autonomous remediation: pull requests, not tickets
When a fixed version exists, Safeguard's Griffin models open a tested, policy gated pull request that moves the affected dependency to the safe version. You can run it on one repository or in bulk across every project that carries the vulnerable version. Remediation covers eight categories, including dependencies, licenses, security posture and findings. Reachability analysis ranks the vulnerable code paths your application actually calls first, so the first pull requests you merge are the ones that matter most. Autonomous remediation ships switched off, with every category set to Manual, so your team decides how much runs on its own and what still needs a human approval.
2. Gold Open Source: the safe version in seconds, free
gold.safeguard.sh is free and needs no login. Search any CVE or package to see affected and fixed versions, CVSS, EPSS, CISA KEV status and a recommended safe version, or use the "Am I affected?" checker. The same data is available through a free read API, README status badges and RSS threat feeds. The safeguard-sh/gold-scan-action GitHub Action can fail a build on a known exploited vulnerability, on any known vulnerability, or never, so a version you have just removed cannot quietly come back in next week's merge.
3. Gold Registry: start from components that are already fixed
registry.safeguard.sh provides hardened, drop in replacements for upstream packages and container images. Every Gold artifact is held continuously to zero exploitable critical or high CVEs, zero malware and a completed license check, with SLSA L3 or higher provenance, a Sigstore signature and a public evidence page you can hand to an auditor. An artifact loses its Gold badge if it regresses. Teams can point their own package directory at the registry so hardened equivalents resolve without changing how developers install anything.
When upstream has no fix yet, or will not ship one, Safeguard first works to get the fix accepted upstream. If the issue is severe or upstream will not move, Safeguard builds a fork, fixes the vulnerability there and publishes a hardened Gold build, so you are not stuck on a maintainer's release schedule. You can also request a hardened, compatibility tested build of a specific package. This fork and patch flow is in early access today, so ask which packages it covers before you plan around it.
| Your situation | What to use |
|---|---|
| A fixed version exists | Autonomous remediation opens the upgrade pull request; Gold Open Source confirms the safe version |
| You need to know today whether you are affected | Gold Open Source lookup and "Am I affected?" checker, free and without login |
| You want vulnerable versions to stop shipping | The Gold scan GitHub Action in CI, plus Safeguard policies and gates |
| Upstream has no fix yet, or will not ship one | A custom Gold request; fork and patch (early access) |
| You want to start clean on new projects | Pull hardened components and images from Gold Registry |
One honest limit: when the vulnerable code lives in a vendor appliance, a hosted service or an operating system runtime you do not build yourself, the fix still has to come from that vendor or distribution. The steps above apply to the open source dependencies and container images you build and ship, which is where most teams carry the largest and least tracked share of their exposure.
See how Safeguard would help
None of these demos involve scattering calculations; they show the software side described in the bridge above.
The first demo is a real Safeguard CLI session: it installs the CLI, opens the interactive terminal and asks it to fix a lodash CVE in a repository. It reads the finding and advisory, asks before any command that changes something, edits package.json to lodash 4.17.21, runs npm install and npm test with approval, prints a summary and pushes nothing. The same flow applies to a web dashboard that displays lidar or air quality data: scan the repository, then let the assistant propose the dependency upgrade under your approval.
Click through it at your own pace, or open it full screen.
The second demo sets up the Safeguard runner on your own machine, approves it with its device code and then scans from the terminal. That suits research groups that keep processing scripts and instrument code on their own workstations or lab servers and want the scan to run where that code lives.
Click through it at your own pace, or open it full screen.
The third demo connects Claude to the Safeguard MCP server with OAuth and lets you choose which tools Claude can use. For an engineer who already works with Claude while writing analysis code, it brings dependency findings into the same conversation, limited to the tools you allow.
Click through it at your own pace, or open it full screen.
To try it on your own repositories, download Safeguard and follow the CLI documentation.
Quick check
How much more strongly is 420 nm light scattered by air molecules than 630 nm light?
The ratio is (630/420)⁴ = (1.5)⁴ = 5.06. Light at 420 nm is scattered about five times more strongly than light at 630 nm.
With a Rayleigh optical depth of 0.22 at 450 nm and the Sun at a zenith angle of 80 degrees (air mass 5.59), what fraction of the 450 nm direct beam survives molecular scattering?
T = exp(−0.22 × 5.59) = exp(−1.23) ≈ 0.29. About 29 percent of the 450 nm light in the direct beam gets through; the rest is scattered out of it, much of it into the sky.
Sources
- NASA Space Place, Why Is the Sky Blue?
- National Weather Service Flagstaff, Why Is the Sky Blue?
- Nobel Foundation, The Nobel Prize in Physics 1904
- Nobel Foundation, Lord Rayleigh facts
- MacTutor History of Mathematics, University of St Andrews, John William Strutt (Lord Rayleigh)
- HyperPhysics, Georgia State University, Blue Sky and Rayleigh Scattering
- Bodhaine, Wood, Dutton and Slusser, "On Rayleigh Optical Depth Calculations", Journal of Atmospheric and Oceanic Technology 16(11), 1999
- NIST Engineering Metrology Toolbox, Refractive Index of Air documentation
- NIST CODATA, speed of light in vacuum
- NIST CODATA, Boltzmann constant
- NIST CODATA, Loschmidt constant
- PVEducation, Air Mass
- Colour and Vision Research Laboratory, UCL, luminous efficiency functions (CIE 1924 photopic V(λ))
- NASA Goddard, Sun Fact Sheet
- NASA Earth Observatory, Aerosols: Tiny Particles, Big Impact
- NASA Earth Observatory, Ozone
- NOAA Global Monitoring Laboratory, SURFRAD Aerosol Optical Depth
- Nobel Foundation, Scientific background on the Nobel Prize in Physics 2009, PDF
- NASA, CALIPSO mission
- PyPI, miepython
- PyPI, numpy
Last reviewed: 25 October 2026.