QuestionLight

Why Do Soap Bubbles and Oil Slicks Show Rainbow Colors?

A soap bubble showing a rainbow pattern from thin-film interference
A soap bubble showing a rainbow pattern from thin-film interference. Image: Pksois23 (CC BY-SA 4.0), via Wikimedia Commons

Soap bubbles and oil slicks show rainbow colors because of thin-film interference, which is a light wave effect. Light reflects from both the front and the back of a very thin film, and depending on the film’s thickness, some colors reinforce each other while others cancel. The colors are not dye in the soap or the oil, and they change as the film thins.

Contents

The full answer

Light is a wave. When a wave reflects off a surface, its crest and trough keep their timing, and two reflected waves can add together or cancel. A soap film has two surfaces, so light bounces back from both. The two reflected beams travel slightly different distances, because the second beam crosses the film twice. If the difference is a whole number of wavelengths, the waves add and that color is bright. If the difference is half a wavelength, they cancel and that color is weak.

The soap water also slows light a little. Water has a refractive index of about 1.33, so light moves about 1.33 times slower inside it than in air. This changes the wavelength inside the film and makes the path difference depend on the film’s thickness. For a film of thickness t viewed close to straight on, bright reflection occurs for colors that satisfy the condition below.

2nt = (m + ½)λ

Here n is the refractive index of the film, t is its thickness, λ is the wavelength of the light in air, and m is a whole number (0, 1, 2 and so on). Each value of m picks out a different color. A film of a given thickness reinforces some colors and cancels others, so the surface appears colored.

The science behind the colors

Visible light has wavelengths from about 380 nanometers (violet) to about 750 nanometers (red). A soap film that shows color is usually about 100 to 1,000 nanometers thick, which is in the same range as these wavelengths. Because the thickness is not even, each part of the bubble reflects a slightly different set of colors. The result is a swirling pattern of bands.

The effect is not the same as the rainbow made by a prism. A prism spreads white light out by refraction, with each color bent by a slightly different amount. Thin-film interference works through the timing of reflected waves, which is why the colors depend on thickness and viewing angle rather than on the shape of a glass object.

Where the thickness changes gradually, the colors blend smoothly, so the boundaries between bands are often soft.

Oil on puddles and other everyday films

An oil slick on a wet road or a puddle shows the same colors. Oil floats on water as a thin, uneven layer, often a few hundred nanometers thick in places. Each region reflects a different set of colors, so the surface looks like a rainbow.

Similar films appear on the surface of a metal that has been heated, where a thin layer of oxide forms, and on the thin coatings used on camera lenses and eyeglasses. Lens coatings are designed so that reflections from the front and back of the coating cancel for certain colors, which reduces glare. The same physics is at work in a soap bubble and in an anti-reflective lens.

Why the colors swirl and the bubble turns black

Soap films are not uniform. Liquid drains down the film under gravity, so the top becomes thinner over time and the bands of color move downward. A bubble that is still gets thinner at the top, and the color pattern keeps changing until the film breaks.

Just before the film breaks, the top becomes thinner than the shortest visible wavelength. Reflections from the two surfaces are then too small to add up to a strong color, and they almost cancel for all visible light. This is why a bubble looks dark or black in a small area before it pops. The black patch is not a hole in the bubble; it is a region where the film is very thin.

Common misconceptions

Some people think soap bubble colors come from dyes or pigments in the soap. Pure soap solution and clean water are colorless, and the colors appear only because of the film’s thickness. A pigment absorbs certain colors, while thin-film interference changes which reflected colors add together.

Another idea is that the colors are caused by a prism effect that splits white light into a rainbow. A soap film does not split light into its colors by bending it the way a prism does. The colors come from waves reflecting from two surfaces.

A third misconception is that a bubble’s colors are the same from every angle. The path difference depends on the angle of view, so tilting a bubble changes the colors you see, which is one reason the pattern seems to shift when you move.

Frequently asked questions

Why do soap bubbles have colors?

The colors come from thin-film interference. Light reflected from the front and back surfaces of the soap film travels slightly different distances, so some colors reinforce each other and others cancel.

Why does a soap bubble look black just before it pops?

The film becomes far thinner than the shortest visible wavelength, about 380 nanometers. Reflections from both surfaces are then too weak and cancel for all visible colors, so the film looks dark.

Why do the colors move around on a bubble?

Liquid drains down the film under gravity, so the top gets thinner and the bands of color shift. The pattern changes as the thickness at each point changes.

Why do oil slicks on water show rainbow colors?

A thin layer of oil on water works the same way as a soap film. Its thickness varies from place to place, so different colors reinforce in different spots.

Is a bubble’s color a pigment?

No. A soap film has no dye, and its colors change with thickness and viewing angle. Pigments absorb particular colors, but thin-film interference only changes which reflected colors add up.

Sources and further reading

  • OpenStax, "University Physics Volume 3"
  • Encyclopaedia Britannica, "Light"

Cite this page

“Why Do Soap Bubbles and Oil Slicks Show Rainbow Colors?.” Atoms & Forces, https://science.bigworldlist.com/questions/why-do-soap-bubbles-show-rainbow-colors/.

More about Refraction