PhysicsIntermediate

Snell's Law Refraction Simulator

Interactive simulation demonstrating Snell's Law of refraction. Explore how light bends when passing between different media, observe critical angles and total internal reflection.

Loading simulation...

Loading simulation, please wait

Snell's Law Refraction Simulator

Verified Content: All equations, formulas, and reference data in this simulation have been verified by the Simulations4All engineering team against authoritative sources including MIT OpenCourseWare physics courses, HyperPhysics, and NIST optical property databases. See verification log

Introduction

Put a drinking straw in a glass of water and look at it from the side. The straw appears snapped in two at the waterline, bent at an impossible angle. Now here's what happens when you actually try this with a laser pointer instead: shine the beam at a shallow angle into an aquarium, and watch it change direction the instant it crosses into the water. That abrupt kink in the light's path puzzled natural philosophers for centuries [1].

What Willebrord Snellius figured out in 1621 was that this bending follows a precise mathematical pattern. The ratio of the sines of the angles (measured from the perpendicular) equals the ratio of something he called the refractive indices of the two materials. The elegant part is that this single equation, n1 sin(theta1) = n2 sin(theta2), explains everything from why pools look shallower than they are to how fiber optic cables carry your internet traffic across oceans [2].

Our interactive simulation puts this discovery in your hands. You can adjust angles, swap materials, and watch the light respond in real time. Whether you're a physics student working through optics problems, a photographer curious about lens behavior, or simply someone who noticed something odd about that straw and wants to understand why, the exploration starts here.

What Is Snell's Law?

If you could slow light down enough to watch, you'd see something peculiar at the boundary between air and water. The wave doesn't just continue straight through. One edge of the wavefront enters the water first and immediately slows down, while the rest is still traveling at full speed through the air. This difference in timing causes the entire wave to pivot, like a car with one wheel suddenly hitting mud [3].

The mathematical relationship Snellius discovered captures this pivot precisely:

n1 sin(theta1) = n2 sin(theta2)

The variables break down as follows:

  • n1 = refractive index of the first medium (where light comes from)
  • n2 = refractive index of the second medium (where light enters)
  • theta1 = angle of incidence, measured from the perpendicular
  • theta2 = angle of refraction, measured the same way

The refractive index itself tells you how much light slows down in a material compared to its speed in empty space. Air barely slows light at all (n = 1.0003). Water slows it noticeably (n = 1.333). Diamond slows it dramatically (n = 2.417), and that extreme slowdown is precisely why diamonds sparkle the way they do.

How the Simulator Works

ParameterSymbolRangeEffect on Light Path
Angle of Incidencetheta10 to 90 degreesSteeper angles produce more dramatic bending; at 0 degrees, light passes straight through
Refractive Index (Medium 1)n11.0 to 3.0Properties of the material light travels FROM
Refractive Index (Medium 2)n21.0 to 3.0Properties of the material light travels INTO
Light Wavelengthlambda400 to 700 nmChanges ray color; different colors bend slightly different amounts (dispersion)

The simulator calculates the refracted angle using Snell's Law directly. When n1 is greater than n2 and you exceed the critical angle, the calculation detects that sin(theta2) would need to exceed 1 (which is impossible), and switches to showing total internal reflection instead.

Using the Simulator

Getting Started

Select one of the preset scenarios at the top of the simulation:

  • Air to Water: The classic demonstration case
  • Air to Glass: What happens when light enters a window
  • Water to Glass: The view through an aquarium wall
  • Fiber Optic: Light trapped inside glass by total internal reflection
  • Air to Diamond: Extreme bending due to high refractive index

Then experiment with the angle slider. Watch how the refracted ray responds as you sweep from 0 to 90 degrees.

Controls at Your Disposal

The angle slider sets theta1 from 0 to 90 degrees in half-degree increments. The medium dropdowns let you choose from air, water, glass, ice, olive oil, diamond, or enter a custom refractive index. The wavelength selector changes the light color (red through violet, or white for all colors together).

Toggle options let you show or hide the normal line (the perpendicular reference), angle measurements, reflected rays, and switch between single ray and beam modes.

Keyboard Navigation

Use the left and right arrow keys for fine control over the angle (0.5 degree steps). Hold Shift while pressing arrows for larger 5 degree jumps. This precision control is especially useful when hunting for the exact critical angle.

Tips from the Lab

Start with the Air to Water preset and verify that the refracted angle matches what Snell's Law predicts for a few different incident angles. Then switch to Fiber Optic mode and slowly increase the angle until you witness total internal reflection, that dramatic moment when the refracted ray vanishes and all the light bounces back. Record measurements at each configuration to build intuition for how the equation behaves.

The Physics Behind Refraction

Why Does Light Bend at Boundaries?

The universe doesn't care about our intuition, but the physics here actually makes sense once you picture it correctly. Light is a wave, and waves have a property called wavelength. When light enters a material where it travels slower, the wavelength shrinks while the frequency stays the same (frequency is determined by the source, not the medium).

Here's an analogy that working physicists often use: imagine a row of people marching arm-in-arm from a paved road onto a sandy beach at an angle. The people who step onto the sand first slow down immediately, while those still on pavement keep their original speed. The whole line pivots toward the perpendicular as a result [3]. That's exactly what happens to a light wavefront at a boundary.

The amount of bending depends entirely on how much the speed changes. Greater speed difference means greater bend. That's why diamond (n = 2.417) bends light so much more than water (n = 1.333). The elegant part is that the refractive index captures this speed ratio directly: n = c/v, where c is light's speed in vacuum and v is its speed in the material [6].

Critical Angle and Total Internal Reflection

Here's where things get strange and wonderful. When light travels from a denser medium to a less dense one (glass to air, for instance), it bends away from the normal. Increase the angle enough, and the refracted ray bends so far that it would have to exit parallel to the surface. Increase a tiny bit more, and... there's nowhere for the refracted ray to go.

At this critical angle and beyond, 100% of the light reflects back into the denser medium. Total internal reflection. No leakage, no absorption, just perfect bounce after perfect bounce [4].

The critical angle calculation is straightforward:

θc = arcsin(n₂ / n₁)

For glass (n = 1.5) to air (n = 1.0), that works out to about 41.8 degrees. This isn't just a curiosity. Fiber optic cables exploit this phenomenon to carry signals across continents with almost no loss. The light literally cannot escape the glass core as long as it hits the walls at steep enough angles.

Light Speed in Different Media

Every physics student learns that light travels at about 300,000 kilometers per second. But that's only true in vacuum. In matter, light slows down according to the refractive index:

v = c / n

In water, light travels at roughly 225,000 km/s. In diamond, only about 124,000 km/s. That's less than half its vacuum speed. This slowdown is real and measurable, and it's the fundamental reason refraction occurs.

What happens to the energy? Good question. The frequency stays constant, the wavelength shrinks, and the wave propagates more slowly. When light exits back into vacuum (or air), it speeds back up. No energy is lost in this process, just rearranged in space.

Learning Objectives

After working through this simulation, you will be able to:

  1. Calculate angles of refraction for any combination of materials using Snell's Law
  2. Explain physically why light bends toward the normal when entering a denser medium (and away when entering a less dense one)
  3. Determine the critical angle for any material pair and predict when total internal reflection will occur
  4. Relate refractive index to the speed of light in different media
  5. Describe how dispersion causes different colors to refract by different amounts
  6. Connect these optical principles to real technologies like lenses, fiber optics, and gemstone cutting

Exploration Activities

Activity 1: Verify Snell's Law with Measurements

Goal: Confirm that the equation actually works by comparing calculation to simulation.

Steps:

  1. Set Medium 1 to Air (n = 1.0003) and Medium 2 to Water (n = 1.333)
  2. Set the incident angle to exactly 30 degrees
  3. Record the refracted angle shown by the simulator
  4. Calculate independently: sin(theta2) = (1.0003/1.333) x sin(30) = 0.375
  5. Therefore theta2 = arcsin(0.375) = 22.0 degrees

What to Look For: Your calculated answer should match the simulator within 0.1 degrees. If it does, Snellius was right. (Spoiler: he was.)

Activity 2: Hunt for the Critical Angle

Goal: Find the exact angle where total internal reflection kicks in.

Steps:

  1. Select the Fiber Optic preset (glass n = 1.52 to air n = 1.0003)
  2. Start at 30 degrees and slowly increase using arrow keys
  3. Watch the refracted ray bend further from the normal
  4. Note the precise angle where the refracted ray vanishes and TIR begins
  5. Compare to the theoretical critical angle: arcsin(1.0003/1.52) = 41.2 degrees

What to Look For: The transition is remarkably sharp. One moment light is escaping (though at a glancing angle), the next moment, complete reflection. This abruptness surprised early experimenters.

Activity 3: Compare Materials Side by Side

Goal: Build intuition for how refractive index affects bending.

Steps:

  1. Set the incident angle to 45 degrees and Medium 1 to Air
  2. Set Medium 2 to Water and record the refracted angle
  3. Change Medium 2 to Glass and record again
  4. Change Medium 2 to Diamond and record one more time

What to Look For: Higher refractive index means smaller refracted angle (light bends more toward the normal). Diamond at n = 2.417 should give a refracted angle around 17 degrees, while water at n = 1.333 gives about 32 degrees. Same incident angle, very different outcomes.

Activity 4: Observe Dispersion Effects

Goal: See why prisms create rainbows.

Steps:

  1. Set up Air to Glass at 60 degrees incidence
  2. Select Red light (650 nm) and note the appearance
  3. Switch to Violet light (400 nm) and compare
  4. Try White light to see the combined effect

What to Look For: Different wavelengths have slightly different refractive indices in most materials. Blue and violet light bend slightly more than red. This is dispersion, the same phenomenon Newton demonstrated with his prism experiments. In most materials the effect is subtle, but in well-cut prisms (or raindrops), the separation adds up to produce visible spectra.

Real-World Applications

Eyeglasses and Contact Lenses

Every pair of glasses you've ever worn exploits Snell's Law to correct vision. Concave lenses diverge light rays to help nearsighted people whose eyes focus images in front of the retina. Convex lenses converge light for farsighted individuals. The precise curvature needed depends entirely on the refractive index of the lens material and the angles involved [5]. Modern lens designs use multiple curved surfaces to minimize aberrations, all calculated from the same basic refraction equation.

Fiber Optic Communications

The internet you're using right now likely traveled through glass fibers thinner than human hair. Inside those fibers, light pulses bounce along by total internal reflection, carrying data at enormous bandwidths with almost no signal loss. The core glass has a higher refractive index than the cladding around it, ensuring that light hitting the boundary at typical angles cannot escape [4]. Signals routinely travel thousands of kilometers through undersea cables without amplification.

Camera and Telescope Optics

Every camera lens is a carefully designed stack of glass elements, each one bending light according to Snell's Law. The goal is to bring all the light from a scene to a sharp focus on the sensor. Different glass types with different refractive indices get combined to correct for chromatic aberration (the dispersion problem where different colors focus at different points). Professional photographers choose lenses partly based on how well the optical designers solved these refraction challenges.

Diamond Brilliance

Why do diamonds sparkle more than glass or crystal? Two reasons, both tied to refraction. First, diamond's refractive index of 2.417 means light bends sharply when entering. Second, that high index means a very small critical angle (about 24 degrees), so light entering a well-cut diamond bounces around internally many times before escaping through the top [8]. This is called the "fire" of a diamond, the rainbow flashes you see as it moves. Gem cutters spend careers learning to maximize this effect.

Underwater Photography and Diving

Divers quickly learn that objects underwater appear about 25% closer and 33% larger than they actually are. This illusion comes from refraction at the water-to-air boundary of the mask. Your brain assumes light travels in straight lines and constructs a mental image based on that assumption. Underwater cameras must compensate for this effect with specially designed "dome ports" that restore normal perspective by creating a virtual image at the right apparent distance.

Reference Data for Common Materials

MaterialRefractive Index (n)Speed of Light (m/s)Typical UseSource
Vacuum1.0000 (exact)2.998 x 10^8Reference standard[6]
Air at 20 C, 1 atm1.00032.997 x 10^8Most environments[6]
Water at 20 C1.3332.249 x 10^8Aquariums, pools[6]
Ice1.312.29 x 10^8Cold environments[7]
Olive Oil1.462.05 x 10^8Kitchen experiments[7]
Crown Glass1.521.97 x 10^8Windows, lenses[6]
Flint Glass1.621.85 x 10^8Prisms, optics[7]
Diamond2.4171.24 x 10^8Gemstones[6]

Note: Values are for yellow light (sodium D-line, 589 nm) at standard conditions. Actual values vary with wavelength, temperature, and material purity.

Challenge Questions

Test your understanding with these problems, arranged from straightforward to genuinely tricky.

Question 1 (Easy): Light enters water from air at 60 degrees from the normal. Does the refracted ray bend toward or away from the normal?

Question 2 (Easy): Can total internal reflection occur when light travels from air into glass? Why or why not?

Question 3 (Moderate): Calculate the critical angle for light traveling from diamond (n = 2.417) into water (n = 1.333). Show your work.

Question 4 (Moderate): A laser beam enters a glass block (n = 1.5) from air at 45 degrees. What is the angle of refraction inside the glass?

Question 5 (Challenging): A fish at the bottom of a pond looks up toward the surface. The fish sees a circular window of the sky directly above, surrounded by what appears to be a mirror reflecting the pond bottom. Explain this phenomenon using critical angle concepts.

Common Misconceptions

What People Often ThinkWhat Actually Happens
Light always bends when entering a new mediumOnly when entering at an angle. At 0 degrees (perpendicular), light passes straight through. The wavefront enters all at once, so there's no differential slowing to cause a pivot.
A higher refractive index always means more bendingThe bending depends on the ratio of indices. Glass-to-water (1.52 to 1.333) produces less bending than air-to-water (1.0003 to 1.333), even though glass has the higher absolute index.
Total internal reflection loses some lightTIR is essentially 100% efficient, which is precisely why fiber optics work so well. No absorption, no leakage, just perfect reflection at every bounce.
All colors of light refract identicallyDifferent wavelengths have slightly different refractive indices in most materials. This dispersion is small but real, and it's the reason prisms separate white light into rainbows.

Frequently Asked Questions

Why does a straw look bent in a glass of water?

Light rays from the submerged portion of the straw bend when they exit the water and travel through air to your eye. Your visual system has no way to detect this bending. It simply assumes light travels in straight lines and traces each ray backward to construct an image. The result is that the underwater portion appears shifted from its true position [2].

What causes the shimmering "water" on hot roads that disappears when you get close?

That mirage is refracted sky. Air near the hot pavement has lower density (and slightly lower refractive index) than cooler air above. Light from the sky curves gradually through this density gradient, eventually bending upward to reach your eye from below. Your brain interprets light coming from below as a reflection, hence the illusion of water [3]. As you approach, your viewing angle changes and the geometry no longer works for the mirage.

How can fiber optic cables carry internet signals across entire oceans?

The fiber core (typically fused silica glass with n around 1.46) is surrounded by cladding with a slightly lower refractive index. Light entering the fiber at appropriate angles exceeds the critical angle at every bounce, experiencing total internal reflection. Because TIR wastes essentially no light, signals can propagate for hundreds of kilometers before needing amplification [4]. Transoceanic cables use this principle continuously.

Why do diamonds sparkle so intensely compared to glass?

Two factors combine. First, diamond's exceptionally high refractive index (2.417 versus about 1.5 for glass) means light bends sharply when entering. Second, that high index produces a critical angle of only about 24 degrees, so most light entering the top of a well-cut diamond bounces around inside rather than leaking out the sides or bottom [8]. Skilled gem cutters angle the facets to maximize this internal bouncing, creating the brilliant "fire" diamonds are famous for.

Does Snell's Law tell you how much light reflects versus refracts?

No. Snell's Law predicts angles only, not intensities. The Fresnel equations handle the intensity question, determining what fraction reflects and what fraction transmits based on angle, polarization, and the refractive indices involved [1]. At normal incidence on glass, about 4% reflects. At grazing angles, much more reflects. At and beyond the critical angle, 100% reflects (total internal reflection).

References

  1. HyperPhysics Refraction of Light. Georgia State University Department of Physics and Astronomy. Available at: http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/refr.html (Free educational resource)

  2. MIT OpenCourseWare 8.02 Electricity and Magnetism, Lecture Notes on Electromagnetic Waves and Optics. Massachusetts Institute of Technology. Available at: https://ocw.mit.edu/courses/physics/ (Free courseware, Creative Commons license)

  3. Khan Academy Light Refraction and Snell's Law Tutorial. Available at: https://www.khanacademy.org/science/physics/geometric-optics (Free video lectures)

  4. The Physics Classroom Total Internal Reflection Lesson. Available at: https://www.physicsclassroom.com/class/refrn/Lesson-3/Total-Internal-Reflection (Free physics tutorials)

  5. National Eye Institute (NIH) How Do Glasses and Contacts Correct Vision? U.S. National Institutes of Health. Available at: https://www.nei.nih.gov/ (Government health resource)

  6. NIST Refractive Index of Optical Materials. National Institute of Standards and Technology. Available at: https://www.nist.gov/ (U.S. government measurement standards)

  7. Engineering ToolBox Refractive Index of Various Substances. Available at: https://www.engineeringtoolbox.com/refractive-index-d_1264.html (Free engineering reference)

  8. Gemological Institute of America Diamond Optical Properties. GIA educational resources. Available at: https://www.gia.edu/ (Industry standard gemology reference)

  9. Feynman, R.P. The Feynman Lectures on Physics, Volume I, Chapter 26: Optics: The Principle of Least Time. California Institute of Technology. Available at: https://www.feynmanlectures.caltech.edu/ (Free access to complete lectures)

About the Data

The refractive index values in this simulation come from NIST databases and peer-reviewed optical property measurements [6][7]. The speed of light in vacuum (c = 299,792,458 m/s) is an exact defined value in the SI system, not a measurement with uncertainty.

Material properties listed represent typical values at standard room temperature (20 C) and pressure (1 atmosphere) for yellow light at 589 nm wavelength. Real values vary with temperature, wavelength, and material purity. For precision applications, consult wavelength-specific tables.

The simulation calculations are exact implementations of Snell's Law and the critical angle formula. Any discrepancy between simulation output and hand calculations should be within floating-point rounding error (less than 0.01 degrees).

How to Cite This Simulation

Simulations4All. (2026). Snell's Law Refraction Simulator. Retrieved from https://simulations4all.com/simulations/snells-law-refraction

For academic papers, you may also wish to cite the primary sources listed in the References section above.

Verification Log

Claim or Data PointSource Verified AgainstStatusVerification Date
Snell's Law equation n₁ sin(θ₁) = n₂ sin(θ₂)HyperPhysics [1], MIT OCW [2]VerifiedJan 2026
Critical angle formula θc = arcsin(n₂/n₁)HyperPhysics [1], Physics Classroom [4]VerifiedJan 2026
Speed of light c = 299,792,458 m/s (exact)NIST [6]VerifiedJan 2026
Water refractive index n = 1.333 at 589 nmNIST [6]VerifiedJan 2026
Diamond refractive index n = 2.417NIST [6], GIA [8]VerifiedJan 2026
Crown glass refractive index n = 1.52Engineering ToolBox [7]VerifiedJan 2026
Total internal reflection principle in fiber opticsPhysics Classroom [4]VerifiedJan 2026
Fresnel equations for reflection/transmission intensityHyperPhysics [1]VerifiedJan 2026
Snellius's 1621 discovery dateMIT OCW [2], historical recordVerifiedJan 2026

Written by Simulations4All Team

Related Simulations

Simple Pendulum
Physics
beginner
1,533

Simple Pendulum

Explore the physics of simple harmonic motion with an interactive pendulum simulation. Adjust length, mass, gravity (including planet presets), damping, and initial angle. Watch real-time energy transformations and measure the period.

View Simulation
Projectile Motion
Physics
beginner
1,260

Projectile Motion

Launch projectiles at different angles and velocities. Explore how gravity and launch parameters affect trajectory, range, and height. Compare with and without air resistance, and test on different planets.

View Simulation
Electric Field Visualization
Physics
intermediate
894

Electric Field Visualization

Visualize electric field lines, vectors, and equipotential surfaces around point charges. Add, drag, and remove charges to explore how fields interact. Launch test charges to see their motion through the field.

View Simulation

Stay Updated

Get notified about new simulations and educational content. We send 1-2 emails per month.