Home › Physics › Snell's Law Calculator
Snell's Law Calculator
Applies Snell's law n₁·sin θ₁ = n₂·sin θ₂ to find the angle of refraction of light passing between two media of known refractive index, detects total internal reflection, and reports the critical angle, the speed of light in each medium and the normal-incidence reflectance.
When to use
You need the refraction angle of a light ray entering water, glass, diamond or another medium, or want to know whether a ray inside the denser medium is totally internally reflected.
Do not use when: You need image positions from lenses or mirrors (use lens-equation), reflectance at oblique angles or with polarisation (Fresnel equations are not implemented), or the wavelength dependence of the index (dispersion).
Formula
n1 × sin(angle_of_incidence_degrees) = n2 × sin(angle_of_refraction_degrees); total internal reflection when n1 × sin θ₁ / n2 > 1; critical_angle_degrees = asin(n2 / n1) for n1 > n2; speed = c / n with c = 299,792,458 m/s; reflectance_normal_incidence_percent = ((n1 − n2) / (n1 + n2))² × 100; deviation_degrees = |θ₁ − θ₂| (refraction) or 180° − 2·θ₁ (reflection)
Snell's law for a flat interface between isotropic media; preset indices are for sodium D light (589 nm) at room temperature from the Wikipedia list (air 1.000293, water 1.333, ice 1.31, crown glass 1.52, flint glass 1.62, diamond 2.417, acrylic 1.49, ethanol 1.361).
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
medium_1 | enum: air | water | ice | glass_crown | glass_flint | diamond | acrylic | vacuum | ethanol | custom | yes | Medium the ray travels in before the surface; choose custom to supply n1. | |
n1 | number | no | Refractive index of medium 1; required for medium_1 = custom and overrides the preset otherwise. Range: > 0, ≤ 10 | |
medium_2 | enum: air | water | ice | glass_crown | glass_flint | diamond | acrylic | vacuum | ethanol | custom | yes | Medium the ray enters; choose custom to supply n2. | |
n2 | number | no | Refractive index of medium 2; required for medium_2 = custom and overrides the preset otherwise. Range: > 0, ≤ 10 | |
angle_of_incidence_degrees | number | ° | yes | Angle between the incoming ray and the normal (perpendicular) to the surface, 0–90°. Range: ≥ 0, ≤ 90 |
Outputs
| Output | Type | Unit | Description |
|---|---|---|---|
n1 | number | Refractive index of medium 1 used. | |
n2 | number | Refractive index of medium 2 used. | |
angle_of_refraction_degrees | number | ° | θ₂ = asin(n₁·sin θ₁ / n₂), measured from the normal; omitted under total internal reflection. |
total_internal_reflection | boolean | True when n₁·sin θ₁ / n₂ > 1, i.e. no refracted ray exists and all light is reflected back into medium 1. | |
critical_angle_degrees | number | ° | asin(n₂ / n₁): incidence angle above which total internal reflection occurs (only when n₁ > n₂). |
deviation_degrees | number | ° | Angle between the incident and outgoing ray directions: |θ₁ − θ₂| for refraction, 180° − 2·θ₁ for total internal reflection. |
speed_in_medium_1_m_s | number | m/s | c / n₁ with c = 299,792,458 m/s. |
speed_in_medium_2_m_s | number | m/s | c / n₂. |
reflectance_normal_incidence_percent | number | % | Fraction of light reflected at the surface for a ray at 0° incidence, ((n₁ − n₂) / (n₁ + n₂))² × 100 (Fresnel, unpolarised). |
Example
Air to water at 30°: {"medium_1":"air","medium_2":"water","angle_of_incidence_degrees":30} → {"n1":1.000293,"n2":1.333,"angle_of_refraction_degrees":22.04,"total_internal_reflection":false,"deviation_degrees":7.96,"speed_in_medium_2_m_s":224900569,"reflectance_normal_incidence_percent":2.0332}
Water to air at 60° (total internal reflection): {"medium_1":"water","medium_2":"air","angle_of_incidence_degrees":60} → {"total_internal_reflection":true,"critical_angle_degrees":48.63,"deviation_degrees":60,"speed_in_medium_1_m_s":224900569}
GET https://tttkmbb.com/api/v1/calculate/snells-law?medium_1=air&medium_2=water&angle_of_incidence_degrees=30
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/snells-law(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/snells-law · Markdown: https://tttkmbb.com/physics/snells-law.md · JSON definition: https://tttkmbb.com/physics/snells-law.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="snells-law" - OpenAPI operationId:
calculate_snells_law_refraction - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
- Wikipedia – Snell's law (reference)
- Wikipedia – List of refractive indices (reference)
- HyperPhysics – Refraction of light (reference)
FAQ
Is the angle measured from the surface or from the normal?
From the normal, the line perpendicular to the surface. A ray hitting the surface at 60° to the surface has an angle of incidence of 30°.
Why is there no angle of refraction for water to air at 60°?
Snell's law would need sin θ₂ = 1.333 × sin 60° / 1.000293 = 1.154, which is impossible; above the critical angle of 48.63° the ray is totally reflected inside the water.
Does the wavelength matter?
Yes, the index depends on wavelength (dispersion): crown glass is about 1.51 for red and 1.53 for violet light. The presets are for 589 nm; enter custom indices for other wavelengths.
Related calculators
- Thin Lens Equation Calculator — Image formation by lenses and mirrors, which rely on refraction and reflection.
- Wavelength & Frequency Calculator — Wavelength in a medium from the reduced speed c / n.