ForHosting KIT · Science

Snell's law calculator

A ray going from air into glass at 30° bends to 19.4712206345°. Enter both refractive indices and the incidence angle measured from the normal to get the refraction angle, or learn that the ray is totally reflected instead. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
N1
1
N2
1.5
Angle incidence
30
You get
Angle refraction
19.4712206345 degrees
Relative index
1.5
Sin incidence
0.5
Sin refraction
0.3333333333

Snell's law relates the angles a light ray makes with the surface normal when it crosses the interface between two transparent media. Written n one times sine of theta one equals n two times sine of theta two, it is the everyday tool for predicting how much a beam bends at air-glass, water-air, or any other pair of refractive indices. This calculator takes the incident index, the transmitted index, and the incidence angle in degrees, returns the refraction angle, and refuses cases where the sine argument would exceed one because those geometries produce total internal reflection beyond the critical angle.

How Snell's law predicts the angle of refraction

Start with two homogeneous isotropic media that meet at a flat interface. Label the refractive index on the side where the ray arrives as n1 and the index on the transmitted side as n2. Measure both the angle of incidence theta one and the angle of refraction theta two from the surface normal, not from the interface plane, so that normal incidence is zero degrees and grazing incidence is ninety degrees.

Snell's law then states that n1 times the sine of theta one equals n2 times the sine of theta two. Solving for the unknown refraction angle yields theta two equals the arcsine of the quantity n1 over n2 times sine of theta one. When light travels into a denser medium, n2 greater than n1, the ray bends toward the normal and theta two is smaller than theta one.

When light leaves a denser medium for a rarer one, n1 greater than n2, the ray bends away from the normal and theta two is larger than theta one. In that rarer-side case there is a critical angle theta c equals arcsine of n2 over n1; any incidence steeper than theta c makes the sine argument larger than one, which has no real refraction angle and corresponds to total internal reflection.

This capability evaluates only the closed-form refraction path: it does not solve for an unknown index from measured angles, does not model layered stacks, and does not ray-trace curved surfaces. Both indices must be finite and strictly positive; the incidence angle must lie in the closed interval from zero to ninety degrees.

Where Snell's law calculators show up in real work

Secondary-school and college optics courses assign endless interface problems that ask for the refraction angle, the critical angle, or whether a ray suffers total internal reflection; a single trusted oracle that returns degrees plus intermediate sines speeds grading and demo setup. Fiber-optic and waveguide teaching labs estimate acceptance angles and check that cladding-to-core indices keep guided modes above the critical condition. Aquarium, pool, and underwater camera designers predict how steep a surface appears from air or how a submerged viewfinder foreshortens.

Prism and spectrometer notebooks convert measured deviation angles into index estimates only after first trusting the forward Snell step used in this calculator. If you later need lens magnification from object and image distances, thin-lens focal-length solving, Brewster-angle polarization, or multi-surface sequential ray tracing, treat those as separate search intents and landings rather than overloading this Snell's law refraction page.

Homework and lab answer keys

Compute refraction angle and critical-angle context from textbook n1, n2, and incidence so teachers and auto-graders share one ground truth.

Fiber and waveguide acceptance checks

Verify whether an input ray at a given incidence stays below the critical angle when leaving core glass into cladding.

Underwater and aquarium viewing geometry

Predict how a ray bends at water-air interfaces when planning poolside sight lines or submerged camera housings.

What formula does this Snell's law calculator use?

n1 · sin(θ1) = n2 · sin(θ2), solved as θ2 = arcsin((n1/n2)·sin(θ1)). Angles are in degrees from the surface normal.

What happens if incidence exceeds the critical angle?

When |(n1/n2)·sin(θ1)| > 1 there is no real refraction angle (total internal reflection). The error message includes the critical angle when n1 > n2.

Are angles measured from the normal or from the surface?

From the surface normal, as in standard Snell's law. Zero degrees is normal incidence; ninety degrees is grazing along the interface.

What units should I use for refractive indices?

Dimensionless absolute refractive indices relative to vacuum (air ≈ 1, water ≈ 1.333, crown glass ≈ 1.52). Both n1 and n2 must be finite and strictly positive.

What does it cost?

The browser tool is free and runs locally.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/optics/snell-law

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/optics/snell-law \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"n1":1,"n2":1.5,"angle_incidence":30}'
{
  "n1": 1,
  "n2": 1.5,
  "angle_incidence": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "optics.snell_law",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How Snell's law predicts the angle of refraction

The pipeline is pure floating-point arithmetic with no network, no random seeds, and no wall-clock timestamps, so identical n1, n2, and incidence always produce identical JSON.

What you send and what you get back

All three fields are required. Classic checks include air to glass with n1 equals one, n2 equals one point five, incidence thirty degrees giving a refraction near nineteen point five degrees, glass to air past the critical angle as the explicit error path, and normal incidence with theta one equals zero giving theta two equals zero. Wire the free browser form for homework and lab demos, then call the identical contract from scripts when you need bulk answer keys. Send three finite numbers under the fields n1, n2, and angle_incidence. n1 is the refractive index of the incident medium, n2 is the index of the refracted medium, and angle_incidence is theta one in degrees measured from the normal. Aliases such as n_i or incident_index for n1, n_t or transmitted_index for n2, and theta1, incidence, or angle_i for the incidence angle are accepted so scripts written against common textbook notation do not need a rename layer. Missing fields, non-numeric strings, NaN, Infinity, non-positive indices, and incidence outside zero to ninety fail with invalid_input and are not charged. When the geometry would produce total internal reflection, that is when the absolute value of n1 over n2 times sine of theta one exceeds one, the request fails with a clear message that refraction exceeds the critical angle, and when applicable the computed critical angle in degrees is mentioned so clients can adjust incidence or indices rather than guessing. On success the response echoes cleaned n1, n2, and angle_incidence, returns angle_refraction in degrees, critical_angle as a number when n1 is greater than n2 or null otherwise, a boolean total_internal_reflection_possible, relative_index as n2 over n1, sin_incidence and sin_refraction for intermediate checks, plus formula and unit strings for display. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where Snell's law calculators show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Read the full KIT documentation →