Thin Film Interference Calculator
Thin Film Interference: Why a Soap Bubble Has Colours, and the Half-Wave Flip Everyone Forgets
The path difference is the easy half. The half-wave flip on reflection is the half that decides whether your film looks bright or dark, and it is the step that turns a correct calculation into a wrong answer. This page counts the flips for you, names the colour that comes back, and draws the film in cross-section at your thickness.
Reflected colour, path difference and the flip count
A soap film 320 nm thick, n = 1.333, air on both sides, light arriving at 20°, first order
The path difference, and the flip that decides what it means
- 2nt cosθfilm
- the optical path difference between the ray reflected off the top of the film and the one that went through it, bounced off the bottom and came back out. The n is there because a wavelength is shorter inside the film; the cos is there because a tilted ray takes a longer slant path but the geometry of the two emerging rays takes part of it back. θfilm is the refracted angle, from sinθfilm = sinθ/n, and using the external angle instead is a standard way to lose a mark
- the half-wave flip
- a reflection off a medium of HIGHER refractive index turns the wave over — a shift of λ/2, equivalently 180°. Reflection off a lower index does not. Count the flips at both surfaces. Two flips cancel; one flip survives and swaps the bright and dark conditions over. Nothing else in this topic is got wrong as often
- m
- the order. One thickness is bright at a whole series of wavelengths, λ = 2nt cosθ/(m + ½) for m = 0, 1, 2, … in the one-flip case. A thin film has only one of those in the visible band and looks strongly coloured; a thick film has many and the colours wash out to white. That is why interference colours are only seen in films a few hundred nanometres thick
- λ/4n
- the quarter-wave anti-reflection thickness. With glass underneath there are two flips, so the DARK condition is 2nt = (m + ½)λ; putting m = 0 gives t = λ/4n. For 550 nm green light on magnesium fluoride at n = 1.38 that is about 100 nm. The reflection is suppressed in the green, which is why coated lenses look purple — the red and blue ends survive
- what this page assumes
- air above the film, a single uniform film, and reflection coefficients ignored. Real films are wedge-shaped, which is why bubbles show bands rather than one colour, and the two reflected beams are not equal in amplitude, so the dark fringes are never perfectly black. The wavelengths of the maxima are unaffected by either
Worked example
A soap film 320 nm thick, n = 1.333, air on both sides, light arriving at 20°, first order
REFRACT INTO THE FILM FIRST. sinθfilm = sin 20°/1.33 = 0.3420/1.33 = 0.2572, so θfilm = 14.90° and cosθfilm = 0.9664. The light inside the film is travelling more steeply than it was outside, which is why the extra path is shorter than 2nt.
THE EXTRA PATH. 2nt cosθfilm = 2 × 1.33 × 320 × 0.9664 = 822.6 nm. That is the whole geometric content of the problem, and it is where most people stop.
COUNT THE FLIPS. Top surface: air (1.00) into film (1.33), going into a denser medium, so that reflection flips. Bottom surface: film (1.33) into air (1.00), going into a rarer medium, so that one does not. One net flip survives.
WHICH CONDITION, THEN. With one flip, bright means 2nt cosθ = (m + ½)λ. For m = 1 that is 822.6 = 1.5λ, so λ = 822.6/1.5 = 548.4 nm — green. Had you forgotten the flip you would have divided by 1 and announced 822.6 nm, which is in the infrared and would mean the film looked dark. Same path difference, opposite answer.
WHAT ELSE IS HAPPENING AT THE SAME TIME. The m = 2 bright wavelength is 822.6/2.5 = 329 nm, ultraviolet and invisible. The dark condition 2nt cosθ = mλ puts a minimum at 822.6/2 = 411 nm, deep violet. So this film reflects green strongly, loses violet, and shows nothing else in the visible — a single clean colour.
TILT YOUR HEAD. Take the same film at 60°: cosθfilm rises to 0.9174 in the numerator chain and the extra path falls to 781.0 nm, putting the first-order bright wavelength at 520.7 nm. The film has not changed at all; the colour has moved 28 nm towards the blue. That is the shimmer you see when a bubble turns.
The four cases you will be asked about, and which way the conditions go
| Situation | n above | n film | n below | Flips | Bright when |
|---|---|---|---|---|---|
| Soap bubble in air | 1.00 | 1.33 | 1.00 | 1 (top only) | 2nt cosθ = (m + ½)λ |
| Oil film on water | 1.00 | 1.47 | 1.33 | 1 (top only) | 2nt cosθ = (m + ½)λ |
| Oil film on glass | 1.00 | 1.47 | 1.52 | 2 (both) | 2nt cosθ = mλ |
| MgF2 coating on glass | 1.00 | 1.38 | 1.52 | 2 (both) | 2nt cosθ = mλ |
| Air gap between two glass plates | 1.52 | 1.00 | 1.52 | 1 (bottom only) | 2t cosθ = (m + ½)λ |
Why a bubble has colours at all, and the one step that decides the answer
A soap film is colourless, and a soap bubble is not. The colour is not in the soap. Light reflects twice — once off the top surface of the film, once off the bottom — and those two reflections come back out side by side, overlapping, having travelled different distances. Where the difference is right they reinforce; where it is wrong they cancel. The film is a few hundred nanometres thick, comparable with a wavelength of light, so the difference is a fraction of a wavelength and the result depends sharply on the colour. That is the whole mechanism, and it is the same mechanism as in Young’s double slit with the two paths stacked vertically instead of side by side.
The geometric part is easy. The ray that goes through the film travels down and back, a distance 2t, in a medium where the wavelength is shorter by a factor n, and at an angle, which takes some of that back. The optical path difference is 2nt cosθfilm. The angle in that expression is the one inside the film, after refraction, not the one you aimed the torch at — the commonest arithmetic slip on this topic, and worth checking before anything else.
Then comes the part that decides the answer. When a wave reflects off a boundary with a higher refractive index, it comes back turned over: a phase shift of 180°, equivalently an extra half wavelength. Reflecting off a lower index does nothing of the kind. So before you can say whether a path difference of one whole wavelength means bright or dark, you have to count the flips at the two surfaces. For a soap film there is exactly one — air into water flips, water into air does not — and the conditions are swapped from the ones you would guess. For a coating on glass there are two, they cancel, and the conditions are the obvious ones. Two situations that look almost identical, with opposite answers.
The quickest way to convince yourself is the black patch. Hold a soap film vertical and it drains; the top goes thinner and thinner, and just before it bursts the top is black, not white. If the path difference were all there was, a vanishingly thin film would give zero path difference, every colour would reinforce, and it would be brilliant white. It is black because the single surviving flip means the two reflections are half a wavelength out of step no matter what the colour is, and they cancel. The flip is not a correction. It is the thing you are looking at.
Where this goes wrong, every time. People find 2nt cosθ, set it equal to mλ, and announce a bright wavelength without having asked what is underneath the film. The index underneath is the input that decides which condition applies, and it is not usually stated in the question — you are expected to notice that the bubble has air behind it and the lens has glass behind it. That is why it is a separate field on this page, with the flip count printed beside the answer.
The same physics, used deliberately, is what makes a coated lens. With glass under the film both reflections flip, so the dark condition is 2nt = (m + ½)λ; a film a quarter of a wavelength thick makes the round trip exactly half a wavelength and kills the reflection. One coating cannot do it for every colour at once, so it is tuned to the middle of the visible band around 550 nm and the red and blue ends leak through — which is exactly why a coated camera lens looks faintly purple when you tilt it. Related reading: the refraction that bends the ray into the film and the lens the coating is sitting on.
Frequently asked questions
Why do soap bubbles and oil slicks show colours?
Because light reflects off both surfaces of the film and the two reflections interfere. The film is a few hundred nanometres thick, so the path difference between them is a fraction of a wavelength, and whether that fraction means reinforcement or cancellation depends on the colour. Each colour is strengthened at a different film thickness, so a film that varies in thickness — and all real films do — shows bands of different colours. The soap and the oil are themselves colourless.
What is the half-wave phase change on reflection?
When light reflects from a boundary where the refractive index is HIGHER than the medium it is travelling in, the reflected wave is turned over: a 180° phase change, which is the same as adding half a wavelength to its path. Reflection from a lower index produces no such change. In a thin film you must count this at both surfaces. Two changes cancel and the conditions are the ordinary ones; one change survives and the bright and dark conditions swap. For a soap bubble in air there is exactly one.
Why does a soap film go black just before it bursts?
Because the path difference has become negligible, and the single half-wave flip at the top surface is all that is left. The two reflected waves are then half a wavelength out of step for every wavelength at once, so they cancel for every colour and the film reflects almost nothing. If there were no phase change on reflection, a vanishingly thin film would be brilliantly bright instead. It is the clearest everyday demonstration that the flip is real.
Why is an anti-reflection coating a quarter of a wavelength thick?
With glass under the coating, both reflections flip and the two cancel, so destructive interference needs 2nt = (m + ½)λ. The thinnest solution, m = 0, is t = λ/4n. For 550 nm light and magnesium fluoride at n = 1.38 that is about 100 nm. The round trip through the film is then half a wavelength, the two reflections cancel, and the light that would have bounced off goes through the lens instead. One coating only works properly at one wavelength, which is why coated optics have a colour cast.
Does the angle of incidence change the colour?
Yes, and you can watch it happen. The extra path is 2nt cosθfilm, so tilting the film shortens it and moves the bright wavelength towards the blue. A 320 nm soap film is bright at 548 nm at 20° and at 521 nm at 60°. Nothing about the film has changed. This is why the colours of a bubble shift as it turns and as you move your head, and it is the usual reason two people disagree about what colour a slick is.
Which angle goes into 2nt cosθ?
The angle inside the film, found from Snell’s law as sinθfilm = sinθ/n. Using the external angle makes the extra path too short and shifts every answer. At 20° external on a film of n = 1.33 the internal angle is 14.90°, and the difference in cos is 0.9397 against 0.9664 — nearly three per cent, which at 320 nm is enough to move the predicted colour by about 15 nm.
Related calculators
References
- OpenStax, College Physics for AP® Courses, section 27.7, Thin Film Interference (read 11 November 2026). States the rule directly: a 180° phase change, equivalently a λ/2 shift, occurs when light reflects from a medium of higher refractive index than the one it is travelling in, and none otherwise; and that constructive interference requires a total shift of a whole number of wavelengths. Its worked examples take the soap film as water at n = 1.333 with air on both sides, and give the magnesium fluoride coating as n = 1.38 on glass of n = 1.52 — the figures quoted on this page. An openly licensed university text, which is why it is cited here in preference to the many coaching pages that assert the same rule without a source.
- NCERT, Physics Textbook for Class XII, Part II, Chapter 10, Wave Optics (chapter text read 11 November 2026). Listed because of what is NOT in it: the rationalised chapter contains no treatment of thin-film interference. Its interference material is Young’s two slits (sections 10.4 and 10.5) and its diffraction material is the single slit (10.6). A CBSE student meeting a thin-film question is meeting material from outside this chapter, and should check the paper’s own syllabus rather than assume it. The copy read was a third-party mirror of the official PDF, not ncert.nic.in itself.
- The International System of Units (SI), 9th edition, Bureau International des Poids et Mesures, 2019. Fixes the speed of light in vacuum at exactly 299 792 458 m/s, which is what makes a refractive index a pure ratio of speeds and lets a wavelength in nanometres be converted into a frequency without any measured constant entering.
- Values of Fundamental Physical Constants, NIST Physical Measurement Laboratory wall chart, 2022 printing (read 11 November 2026). Used on this page only for the exact speed of light. The refractive indices quoted for petrol and light oils, about 1.45 to 1.48, are the usual textbook range and were not verified against a primary refractive-index table for this page; treat them as indicative rather than measured.
