Why Soap Bubbles Paint the Sky: The Simple Formula Behind Every Rainbow You See
A soap bubble floats in sunlight. Inside its paper-thin film of water, something remarkable happens: white light fractures into a trembling ribbon of color, shifting from green to crimson as the bubble drains. Touch it, and the colors vanish in a dark flash — the film has ruptured, and with it, the physics that made the rainbow.
This is thin film interference. The formula that explains it has been known for over a century, and it governs far more than party decorations. It is the same principle inside every camera lens coating that lets you see clearly, behind the iridescent sheen of a butterfly wing, and in the exact measurement of wavelengths too small to see directly.
When Light Splits in Two
Light arriving at a thin film doesn’t just bounce off the surface. Some of it reflects immediately from the outer boundary — the air-water interface. The rest penetrates the film, travels through its thickness, bounces off the lower surface, and exits back upward. Now you have two beams traveling slightly different distances. When they recombine in your eye, they either amplify each other or cancel out, depending on how the distances compare to the wavelength.

The key relationship is:
2nd·cos(θ’) = mλ (for bright fringes)
2nd·cos(θ’) = (m + ½)λ (for dark fringes)
where n is the film’s refractive index, d is its thickness, θ’ is the refracted angle inside the film, m is an integer, and λ is the wavelength of light. The extra half-wavelength on the dark fringe side accounts for a phase flip that occurs whenever light reflects from a medium denser than the one it came from.
This is why the formula has that ½ in it — that half-wavelength shift is what makes the difference between a bright color and darkness.
The Fourth Power That Paints the World
The most important thing the formula doesn’t show explicitly is the wavelength relationship embedded in the physics. When light reflects from a boundary where refractive index increases, the phase flip corresponds to a path difference of exactly half a wavelength — λ/2. That half-wavelength matters more for short wavelengths.
Look at what happens when white light hits a soap film. Red light has a wavelength around 650 nanometers. Blue light is around 450 nanometers. The shorter blue wavelengths interfere constructively at different film thicknesses than the longer red wavelengths. As the bubble drains and the thickness varies from top to bottom, different colors constructive interfere at different positions — producing the vertical rainbow bands you see.
At any given thickness, only specific wavelengths are bright. The others are suppressed. The film acts as a color filter controlled by thickness.
Newton’s Rings: A Century-Old Measurement Tool
In the 1660s, Isaac Newton observed what happens when a convex lens rests on a flat glass plate — a thin air film between them produces concentric dark and bright rings when illuminated from above. These “Newton’s rings” appear because the film thickness increases as you move away from the point of contact, creating a spatial map of constructive and destructive interference.

The rings were the first practical application of thin film interference as a measurement tool. If you know the wavelength of light and you can measure the radius of a bright ring, you can calculate the curvature of the lens — or, conversely, if you know the lens curvature, you can infer the wavelength of the light. It was a precision measurement technique before precision measurement tools existed.
Modern versions of Newton’s rings are still used in nanotechnology. Ellipsometry — a technique for measuring the thickness of films down to a few atomic layers — is based on the same principle. The film thickness is extracted by analyzing how polarized light interferes after reflecting from the sample.
Why Camera Lenses Are Dark
Walk into any camera store and pick up a lens. Look at the front element — it appears dark, almost purple. That is a thin film coating, typically less than a micrometer thick, engineered to eliminate reflections.

Without coating, each air-glass interface reflects roughly 4% of incident light. A typical camera lens has 6–8 glass elements. Uncoated, that would mean 20–30% of light reflected away before it ever reached the sensor. The coating is designed so that reflections from the top and bottom surfaces of the coating interfere destructively — cancel each other out — for the wavelengths of visible light. The energy has nowhere to go, so it must pass through instead.
This is the same anti-reflective principle used on eyeglass lenses, solar panels, and the glass on your phone screen.
The Colors Nature Already Knew
Soap bubbles are a casual demonstration. But thin film interference appears throughout nature, often producing effects that took human engineers decades to replicate.
Peacock feathers get their iridescent blue not from pigments but from microscopic layered structures — melanin and keratin — that act as thin films at the scale of hundreds of nanometers. The precise spacing of these layers determines which wavelength constructive interferes, and that spacing is genetically controlled. The same physics appears in the wings of morpho butterflies, in beetle shells, and in the leaves of some tropical plants.
The structural color of these organisms has a quality that pigment-based color cannot match: it does not fade. Pigments degrade chemically over time. The thin film structure is purely physical — as long as the physical geometry is maintained, the color persists. Museum specimens of beetles and butterflies from the 1800s still show their iridescence intact.
The Interactive Model That Makes It Concrete
Seeing thin film interference described in equations is one thing. Watching it respond to parameter changes is another.
The Thin Film Interference simulator at ElysiaTools lets you manipulate film thickness, refractive index, incident angle, and wavelength directly. Move a slider and watch the fringe pattern shift in real time. Switch from monochrome to white light and see the pattern dissolve into color — each wavelength constructive interfering at a different thickness.
The interactive optical path diagram shows the two reflected beams traveling their different routes through the film simultaneously. Snell’s law relates the incident and refracted angles. The phase shift indicator shows exactly where the half-wave flip occurs. It is the kind of visceral understanding that a static textbook diagram cannot provide.
The Formula Is Simple. The Applications Are Everywhere.
Thin film interference is one of those physical principles that appears deceptively simple — two beams, a path difference, constructive or destructive — and turns out to govern a cross-section of everyday technology and natural beauty.
From the phone screen you are reading now to the butterfly outside your window, from the lens coating that cost decades of optical engineering to the soap bubble a child blows on a summer afternoon, the same 2nd·cos(θ’) relationship is at work. It is a reminder that the most elegant physics often hides in plain sight — in the shimmer on a soap film, in the deep purple sheen of a camera lens, in the colors of a peacock’s feather.
The bubble pops. The physics remains.

