Light bends when it changes speed. Send a ray down onto the boundary between two materials and watch it split — part reflects, part crosses over and refracts, kinking toward or away from the dashed normal. The bend follows Snell's law, n₁·sinθ₁ = n₂·sinθ₂: into denser glass it swings toward the normal, back out into air it swings away. Push the angle far enough going from glass to air and the ray cannot escape at all — total internal reflection, the trick behind optical fibres. Drag the incoming ray or set the angle and the two media, and read every angle live. It all runs on your device.
Drag the incoming ray, or use the angle slider below
Presets
Angle of incidence θ₁45°
Angle of refraction θ₂—
n₁ → n₂1.52 → 1.33
Critical angle θc—
Behaviour—
Refraction angle θ₂ against incidence angle θ₁ for the current media. The amber dot is your current setting; beyond the critical angle the curve stops and the rose band marks total internal reflection.
Toward the normal into denser, away from it into rarer. The refractive index n says how much a material slows light. Crossing into a higher-index medium the ray bends toward the normal; crossing into a lower-index one it bends away — always keeping n₁·sinθ₁ = n₂·sinθ₂. Go from dense to rare and there is a limit: past the critical angle θc = arcsin(n₂/n₁) the refracted ray would have to lie flat along the surface, so instead all of the light reflects back inside. That is total internal reflection, and it is what pipes light down an optical fibre.
Reading the simulation
What the rays, the arcs and the θ₂–θ₁ curve are telling you.
1
Which way the ray bends
The amber ray comes in and the cyan ray crosses into medium 2. Entering a denser medium (higher n) the refracted ray bends toward the dashed normal, so the labelled arc θ₂ is smaller than θ₁; entering a rarer medium it bends away and θ₂ is larger. Set Air → Glass and then Glass → Air to see the bend flip direction.
2
The reflected ray is always there
At every angle a second amber ray reflects back into medium 1 at the same angle as the incident ray. Its thickness in the simulation grows with how much light reflects — small at steep, near-normal incidence and rising as the ray grazes the surface — so you can see that reflection and refraction always share the incoming light.
3
Past the critical angle: total internal reflection
Going from a denser to a rarer medium there is a limit. The rose guide line marks the critical angle θc = arcsin(n₂/n₁); on the θ₂–θ₁ curve it is where θ₂ reaches 90° and the curve stops. Push θ₁ beyond it and no ray escapes — the refracted ray vanishes, all the light reflects, and the panel flags total internal reflection. Try the Water → Air preset.
How It Works
A change of speed at the boundary, a bend set by Snell's law, and a limit where light can no longer escape.
1
A ray meets a boundary
An incoming ray strikes the flat interface between two media and splits in two: some light reflects back into the first medium at the same angle, and the rest crosses into the second medium. All angles are measured from the dashed normal — the line perpendicular to the surface.
2
Snell's law sets the bend
The transmitted ray changes direction because light travels at a different speed in each material. The refractive indices and the angles obey n₁·sinθ₁ = n₂·sinθ₂, so entering a denser medium (higher n) the ray bends toward the normal, and entering a rarer one it bends away. Change the media and the angle and the readout updates both angles at once.
3
The critical angle
Going from a denser to a rarer medium, the refracted ray leans further from the normal as you raise the incidence angle. At the critical angle θc = arcsin(n₂/n₁) it lies flat along the surface, and beyond it Snell's law has no solution — the light is completely reflected back inside. Set glass or diamond on top of air and sweep the angle to watch total internal reflection switch on.
What is refraction?
Refraction is the bending of a wave — light, sound or water waves — as it passes from one medium into another where it travels at a different speed. Light slows down in denser materials, and at a slanted boundary the change of speed makes the ray change direction. It is why a straw looks broken at the water's surface and why lenses can focus light. This simulator shows a ray bending as it crosses a boundary and lets you change the angle and the materials.
What is Snell's law?
Snell's law relates the angles a ray makes with the normal on each side of a boundary to the refractive indices of the two media: n₁·sinθ₁ = n₂·sinθ₂. Because the index measures how much a material slows light, a ray entering a denser medium (larger n) bends toward the normal, and a ray entering a rarer medium bends away from it. This tool draws the labelled θ₁ and θ₂ arcs and a θ₂-vs-θ₁ curve, and reads both angles live as you change the incidence angle and pick air, water, glass, diamond or a custom index.
What is total internal reflection?
When light travels from a denser medium toward a rarer one, the refracted ray bends away from the normal. Beyond a certain incidence angle — the critical angle, θc = arcsin(n₂/n₁) — Snell's law has no solution and none of the light gets out: it is all reflected back into the denser medium. This is total internal reflection, and it is how optical fibres trap light and why a diamond sparkles. Click the Water → Air preset, or set any denser medium on top, and raise the angle past the critical angle to watch it switch on.
Why does a straw look bent in a glass of water?
The light from the underwater part of the straw refracts as it leaves the water and enters the air, bending away from the normal because air is the rarer medium. Your eye traces that bent ray back in a straight line, so the submerged part appears shifted from where it really is, and the straw looks broken at the surface. It is the same Snell's-law bending this simulator shows — the size of the shift depends on the angle and on how different the two indices are.
A ready-to-assign lab using the simulation above. Free to use — nothing to install or sign up for, and no student data leaves the browser.
High school, College10–20 minInteractive simulation
Learning objectives
Apply Snell’s law at an interface.
Relate bending direction to the change in medium.
Explain total internal reflection and the critical angle.
Variables to change
Angle of incidence
Index of medium 1
Index of medium 2
Procedure
Send light from air into a denser medium and measure the refraction angle.
Increase the angle of incidence and watch how the refracted ray bends.
Send light from the dense medium toward air and increase the angle until the ray no longer exits.
Observations
Record incidence and refraction angles for several trials, including the angle where total internal reflection begins.
Questions
Which way does light bend going from a less dense to a more dense medium?
State Snell’s law.
What is the critical angle?
What is total internal reflection and where is it used?
Why does light bend at all when changing media?
Explanation
Refraction bends light because its speed changes between media, following Snell’s law n₁sinθ₁ = n₂sinθ₂. Going into a denser medium bends light toward the normal; going the other way, angles past the critical angle cause total internal reflection, the basis of fiber optics.
Answer key (for instructors)
1. Toward the normal (it slows down, so the refraction angle is smaller).
2. n₁·sinθ₁ = n₂·sinθ₂.
3. The incidence angle (going to a less dense medium) at which the refracted ray grazes the surface at 90°; beyond it, total internal reflection occurs.
4. All light reflects back into the denser medium when the angle exceeds the critical angle; it is used in optical fibers.
5. Its speed changes between media; the change in speed redirects the wavefronts.
Put the Refraction & Snell\ on your own page — free, no sign-up, no watermark. It runs entirely in your visitors' browsers. Copy the snippet and paste it into your page's HTML.
The credit line under the widget links back to LK Forge — please keep it so others can find it too.