Snell's Law Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

Enter indexes and incident angle to find the refracted angle.
The diagram will update after you enter values.

Refraction Relay Challenge

Practice Snell's law by steering photons through shifting media—match the refracted beam to glowing windows before each pulse crosses the interface.

n₁ sin θ₁ = n₂ sin θ₂

Score 0
Best 0
θ₁ Aim
θ₂ Output
Target
Chain ×1
n₁ 1.000 → n₂ 1.333 Pulse ETA 0.0s
Baseline interface

Drag or swipe on the canvas (keyboard ←/→ for accessibility) to tune θ₁. Press space to trigger a stabilization burst when ready.

Why a Visual Matters

Refraction is a directional phenomenon: light changes course when crossing a boundary. Numbers alone can hint at this bend, yet a diagram communicates the geometry instantly. The canvas above redraws the incident and refracted rays every time you adjust the indices or the incoming angle. Seeing the line tilt more steeply or even reflect entirely when total internal reflection occurs offers an intuitive grasp of Snell’s law that complements the numeric result. The visualization also resizes with your screen, ensuring that whether you are on a phone or a desktop monitor, the relationship between angles remains clear. For accessibility, the figure caption summarizes the current configuration so that screen readers convey the same information as the image.

Visual tools are especially valuable when teaching students who are encountering wave behavior for the first time. A set of trig equations may look forbidding, but a moving ray that responds in real time to their inputs makes the abstraction concrete. Learners can watch the refracted beam slide closer to the normal as they increase the second medium’s index, or see the beam rebound when they dial in a critical angle. These quick experiments encourage curiosity and make it easier to build intuition for more advanced optical concepts.

Professionals benefit as well. Optics designers sketch dozens of ray diagrams when prototyping a lens system. The interactive canvas offers a lightweight way to test rough scenarios without opening a full ray-tracing suite. When collaborating remotely, a shared screenshot of the diagram communicates ideas faster than a paragraph of text. The responsiveness of the visualization means you can explore “what if” questions rapidly and keep track of how small changes ripple through the geometry.

Mathematics of Refraction

The governing relationship is Snell’s law, which ties the sine of the angles to the refractive indices of the two media:

n1sinθ1=n2sinθ2

Where n1 and n2 represent the indices of refraction in the first and second medium, respectively, and the angles are measured from the normal. Rearranging for the unknown refracted angle yields:

θ2=arcsinn1sinθ1n2

This formula assumes that both materials are isotropic and homogeneous, so their refractive indices do not depend on direction or position. It also presumes that the interface between the two media is flat and that the light has a single wavelength. Despite these simplifications, Snell’s law accurately predicts a vast range of optical behaviors from the bending of sunlight in our atmosphere to the focusing action of camera lenses.

Derivations of Snell’s law can emerge from different physical principles. In introductory physics, one might derive it from Fermat’s principle of least time, showing that the path taken by light minimizes travel time. In electromagnetic theory, the law arises from matching boundary conditions of the electric and magnetic fields at the interface. These complementary viewpoints demonstrate that Snell’s law is not merely an empirical rule but a consequence of deeper symmetries in nature.

Worked Example

Imagine a beam of light traveling through air n1=1.000 striking a pool of water n2=1.333 at an incident angle of 30°. Plugging into Snell’s law gives θ2=arcsin1.000sin30°1.333, yielding a refracted angle of roughly 22°. When you enter these numbers into the calculator, the ray in the canvas bends toward the normal, visually confirming the algebra. Change the second medium to glass with n2=1.50 and you will see an even sharper bend with a refracted angle near 19.5°. The dynamic feedback turns abstract trigonometry into a tangible ray diagram.

The example can be extended by considering the reverse direction. If the beam begins in water and tries to exit into air at the same 30° incidence, the calculator will announce total internal reflection. The canvas shows the ray bouncing back into the water, emphasizing that Snell’s law still holds but predicts an impossible sine value. This direct comparison reveals why divers experience a mirrored surface when they look up at shallow angles.

You can experiment further by increasing the incident angle while keeping the indices fixed. The figure demonstrates how the refracted ray gradually approaches the interface until the critical angle is reached. Watching this progression helps students grasp that total internal reflection is not a sudden magical effect but the culmination of a continuous trend.

Scenario Comparison

The table below compares several common transitions while holding the incident angle at 40°. These scenarios help illustrate how higher index contrasts lead to stronger bending or even total internal reflection.

Medium 1 (n₁) Medium 2 (n₂) Refracted Angle θ₂
Air (1.00) Water (1.33) 28.9°
Air (1.00) Glass (1.50) 25.4°
Water (1.33) Air (1.00) Total internal reflection
Glass (1.50) Air (1.00) Total internal reflection

When the light tries to move from a denser medium to a less dense one at this angle, the sine of the predicted refracted angle exceeds one, which is physically impossible. The calculator and canvas both report total internal reflection in these cases.

By entering these values yourself, you can watch the diagram snap from a transmitted to a reflected ray as soon as the critical threshold is crossed. The table becomes more than numbers; it is a set of launch points for visual experiments that highlight the logarithmic sensitivity of the sine function near the limits of its domain.

How to Interpret the Diagram

The horizontal line in the canvas marks the boundary between the two media. The vertical dashed line is the normal. The yellow ray entering from the upper left represents the incoming beam at angle θ₁. If refraction occurs, a blue ray emerges in the lower medium at angle θ₂. When total internal reflection happens, only a reflected ray appears, bouncing back into the first medium. The relative steepness of the rays directly conveys how the angles compare. Because the canvas scales to your screen, lengths are not to physical scale; only the angles carry meaning. The figcaption beneath the canvas reiterates the numerical values so that the visual message is also accessible to users of assistive technology.

The color scheme reinforces the distinction between media: the upper half is tinted pale blue to suggest air, while the lower half is greenish to evoke water or glass. These cues help you orient yourself when experimenting with different indices. If you resize the window, the drawing rescales but the center point remains fixed, mirroring the invariant physical interface in real optical setups.

Limitations and Real‑World Insights

The calculator assumes perfectly smooth interfaces and ignores wavelength dependence. Real surfaces can be rough or curved, scattering light and complicating the simple picture drawn here. Materials also exhibit dispersion, meaning n varies with color. At high intensities, nonlinear effects can even break Snell’s law. Nevertheless, the classic formulation remains a powerful starting point. In fiber optics, for example, designers deliberately choose core and cladding indices to keep θ₁ below the critical angle, trapping light via total internal reflection. Underwater photographers rely on understanding refraction to correct for apparent depth. While the visualization here is simplified, it mirrors the core geometry that governs these technologies.

Another limitation is the assumption of a single interface. Complex optical systems involve multiple surfaces, each with its own angle and material properties. Real lenses also curve, meaning that the angles vary across the surface. Yet even in these cases, engineers break the system into small regions that each obey Snell’s law locally. The principles explored with this calculator therefore form the building blocks of more advanced optical design.

Embed this calculator

Copy and paste the HTML below to add the Snell's Law Calculator - Find Angle of Refraction to your website.