Index of Refraction Calculator

Compute refracted angles, refractive indices, and critical angles using Snell's Law. Visualize light bending at the interface between two media with an interactive ray diagram. Ideal for physics students, optical engineers, and anyone exploring the behavior of light.

Enter known values. The tool will compute the missing parameter based on your selected mode. Angles in degrees.
? Air→Water : n₁=1.0003, θ₁=30°, n₂=1.333
? Air→Glass : n₁=1.0003, θ₁=45°, n₂=1.500
? Water→Air : n₁=1.333, θ₁=40°, n₂=1.0003
? Diamond→Air : n₁=2.417, θ₁=20°, n₂=1.0003
? Glass→Water : n₁=1.500, θ₁=35°, n₂=1.333
Privacy first: All calculations run locally in your browser. Your data never leaves your device.

Understanding the Index of Refraction and Snell's Law

The index of refraction (or refractive index) of a material is a dimensionless number that describes how light propagates through that medium. It is defined as the ratio of the speed of light in vacuum to the speed of light in the material: n = c / v. When light passes from one medium to another, its speed changes, causing the light ray to bend — a phenomenon known as refraction. The relationship between the angles of incidence and refraction is governed by Snell's Law:

n₁ · sin(θ₁) = n₂ · sin(θ₂)

where n₁ and n₂ are the refractive indices of the two media, and θ₁ and θ₂ are the angles measured from the normal to the interface.

This fundamental law of optics, discovered independently by Ibn Sahl in the 10th century and later by Willebrord Snellius in 1621, underpins everything from the design of eyeglass lenses and camera optics to fiber-optic communications and astronomical observations. Our interactive calculator lets you explore these principles in real time.

Why Use This Interactive Refraction Tool?

  • Visual Learning: The ray diagram updates instantly as you change parameters, helping you see how light bends — or reflects — at the interface.
  • Educational Aid: Perfect for verifying homework, preparing for exams, or teaching the principles of geometrical optics.
  • Engineering & Design: Optical engineers can quickly test lens configurations, coating designs, and fiber-optic coupling scenarios.
  • Research & Exploration: Easily compute critical angles and explore total internal reflection conditions for various material pairs.

How the Calculator Works

The tool implements Snell's Law with three distinct modes to accommodate different user needs:

  1. Find θ₂: Given n₁, θ₁, and n₂, the calculator computes the refracted angle θ₂ = arcsin(n₁·sin(θ₁) / n₂). If the argument exceeds 1, total internal reflection (TIR) occurs — the tool will alert you.
  2. Find n₂: Given n₁, θ₁, and θ₂, the calculator determines the refractive index of the second medium: n₂ = n₁·sin(θ₁) / sin(θ₂).
  3. Critical Angle: Given n₁ and n₂ (with n₁ > n₂), the tool computes the critical angle θc = arcsin(n₂ / n₁), above which TIR occurs.

All calculations are performed with double-precision floating-point arithmetic to ensure high accuracy. The ray diagram is rendered on an HTML5 canvas, with incident, refracted, and (where applicable) critical rays clearly distinguished.

Step-by-Step Calculation Process

  1. Select your desired calculation mode using the radio buttons.
  2. Enter the known values — the tool will highlight which fields are required.
  3. Click Calculate & Draw to compute the result and update the ray diagram.
  4. Review the step-by-step solution shown below the results, which details how Snell's Law was applied.
  5. Use the preset examples to quickly explore common material combinations.

Common Materials and Their Refractive Indices

The table below lists refractive indices (at ~589 nm, sodium D-line) for a selection of optical materials. Values may vary slightly with wavelength (dispersion) and temperature.

Material Refractive Index (n) Optical Density Typical Application
Vacuum 1.000000 Lowest Reference standard
Air (STP) 1.000293 Very low Atmospheric optics
Water (20°C) 1.333 Low Aquatic optics, lenses
Ice 1.309 Low Polar optics
Fused silica (SiO₂) 1.458 Moderate UV optics, windows
Crown glass (BK7) 1.517 Moderate Lenses, prisms
Flint glass (SF10) 1.728 High Chromatic correction
Dense flint glass 1.800 High High-index lenses
Sapphire (Al₂O₃) 1.768 High Scratch-resistant optics
Diamond 2.417 Very high Brilliant cut, spectroscopy
Silicon (Si) 3.48 Extremely high IR optics, photonics
Germanium (Ge) 4.00 Extremely high Thermal imaging, IR

Values are approximate and wavelength-dependent. For precision work, consult manufacturer datasheets.

Case Study: Fiber-Optic Communication

Modern fiber-optic networks rely on the principle of total internal reflection (TIR) to confine light within the core of an optical fiber. A typical fiber consists of a high-index core (n₁ ≈ 1.47, silica) surrounded by a lower-index cladding (n₂ ≈ 1.45). The critical angle for this pair is θc = arcsin(1.45 / 1.47) ≈ 80.6°. Any light entering the fiber at an angle greater than this relative to the normal will be completely internally reflected, allowing signals to travel over long distances with minimal loss. Our calculator lets you explore these critical conditions interactively — try the Critical Angle mode with n₁ = 1.47 and n₂ = 1.45 to see for yourself.

The History and Discovery of Snell's Law

The phenomenon of refraction was known to ancient scholars, but the mathematical relationship was first accurately described by the Persian mathematician Ibn Sahl in 984 CE, who discovered the law of refraction in his work On the Burning Instruments. However, his findings were largely unknown in the West. The law was rediscovered independently by the Dutch astronomer Willebrord Snellius in 1621, and later formalized by the French philosopher René Descartes in his Dioptrique (1637). Descartes published the law in the form we use today, though he did not credit Snell. The modern formulation, n₁·sinθ₁ = n₂·sinθ₂, was established by Christiaan Huygens in his Treatise on Light (1690), who also provided the wave-theory explanation of refraction. This historical progression illustrates how scientific knowledge builds incrementally across cultures and centuries.

Common Misconceptions About Refraction

  • "Light always bends toward the normal when entering a denser medium." — True only if the incident medium is less dense. If light goes from a denser to a rarer medium, it bends away from the normal.
  • "The index of refraction is the same for all colors." — False. Refractive index varies with wavelength (dispersion), which is why prisms separate white light into a spectrum.
  • "Total internal reflection only happens in diamonds." — TIR occurs whenever light travels from a denser to a rarer medium at an angle exceeding the critical angle. Diamond's high n just makes the critical angle very small (≈24.4°), giving it its famous sparkle.
  • "Snell's Law only applies to visible light." — The law applies to all electromagnetic waves, including radio waves, microwaves, and X-rays, wherever refraction occurs.

Real-World Applications

  • Ophthalmology: Corrective lenses and intraocular implants are designed using refractive indices to focus light precisely on the retina.
  • Astronomy: Atmospheric refraction bends starlight, causing stars to appear slightly higher in the sky than their true position. This effect must be accounted for in telescope pointing.
  • Optical Coatings: Anti-reflective coatings on lenses use thin films with specific refractive indices to cancel reflected light via destructive interference.
  • Laser Physics: Refractive index gradients are used in gradient-index (GRIN) lenses to focus light without curved surfaces.
  • Geophysics: Seismic waves refract through Earth's layers, and Snell's Law is used to model their paths and infer the planet's internal structure.

Grounded in optical physics — This tool implements Snell's Law as described in standard physics textbooks (e.g., Optics by Eugene Hecht; Introduction to Modern Optics by Grant Fowles). The interactive ray diagram follows the conventions of geometrical optics. Calculations have been cross-validated against independent implementations and known material data. Reviewed by the GetZenQuery tech team, last updated July 2026.

Frequently Asked Questions

The index of refraction (n) is the ratio of the speed of light in vacuum to the speed of light in a material. It describes how much light slows down and bends when entering a medium. For example, n = 1.333 for water means light travels at about 75% of its vacuum speed in water.

TIR occurs when light traveling from a denser medium (higher n) to a rarer medium (lower n) strikes the interface at an angle greater than the critical angle. Instead of refracting, all light is reflected back into the denser medium. This is the principle behind fiber optics.

In ordinary materials, n ≥ 1 because the speed of light in any material is less than or equal to c. However, in certain metamaterials and near resonant frequencies, n can be less than 1 or even negative (negative-index metamaterials). These are exotic cases not covered by this calculator.

All calculations use double-precision floating-point arithmetic, providing accuracy to about 15 decimal places. For typical educational and engineering purposes, this is far more than sufficient. The main source of inaccuracy comes from input values and material data approximations.

No — this calculator assumes a single wavelength (monochromatic light) and uses a fixed refractive index for each material. For problems involving dispersion (different colors), you would need to use wavelength-dependent indices. We may add a dispersion feature in a future update.

Excellent resources include Khan Academy's optics section, Optics.org, and the classic textbook Optics by Eugene Hecht. For interactive simulations, visit PhET's Bending Light.
References: Hecht, E. (2017). Optics (5th ed.). Pearson. Fowles, G. R. (1989). Introduction to Modern Optics. Dover. Wikipedia: Snell's Law; Britannica: Refractive Index.