Index of Refraction Calculator

Convert between refractive index and the speed of light in a material, then trace a ray across the boundary with Snell's law.

🔍 Index of Refraction Calculator
Pick a material (optional)fills in n for you
I know the
Unit of the speed (used only when you enter v)
Valuen, or v in the unit above
Vacuum wavelength (optional)gives the wavelength in the medium
nm
Indices of the two medialight goes from medium 1 into medium 2
n1 (incoming side)
n2 (other side)
Angle of incidence θ1from the normal
°
Known medium
n1
Measured anglesboth from the normal
Incidence θ1 (°)
Refraction θ2 (°)
Index of refraction n
—
Speed of light v = c / n
—
Speed as a share of c
—
Time to cross 1 m
—
Wavelength in the medium
—
Frequency (unchanged)
—

Typical values for yellow light near 589 nm. The row closest to your n is in bold.

Angle of refraction θ2
—
Critical angle
—
Bending
—
Deviation |θ1 − θ2|
—
Speed in medium 1
—
Speed in medium 2
—

Ray diagram: medium 1 is above the line and medium 2 is below. The blue ray is incident, the green ray is refracted, and the red ray is the reflected part (dashed when most light is refracted, solid when it is total internal reflection). The dashed vertical line is the normal.

Index of medium 2, n2
—
Speed in medium 2
—
Bending
—
Critical angle for this pair
—

Ray diagram drawn from your two angles. The blue ray arrives in medium 1 (above the line), the green ray continues into medium 2, and the red dashed ray is the partial reflection.

🔍 What is the Index of Refraction?

The index of refraction, also called the refractive index, tells you how much a material slows down light. It is the ratio n = c / v of the speed of light in vacuum to the speed of light in the material. Vacuum has n = 1 by definition, air is just above 1, water is about 1.33, ordinary glass about 1.5 and diamond about 2.42. A larger index means slower light. The index has no unit, and for ordinary transparent materials it is never below 1. This calculator turns an index into a speed, or a speed into an index, and also gives the wavelength light takes on inside the material.

The index matters because it controls how light bends at a boundary. Snell's law, n1 sin θ1 = n2 sin θ2, links the angle of the incoming ray and the angle of the outgoing ray. That is the working principle of eyeglasses, camera lenses, microscopes, prisms and the optical fibers that carry internet traffic. When light goes from a dense material to a less dense one, there is a limit, the critical angle, beyond which no light escapes and the surface acts as a perfect mirror. Jewelers use the high index of diamond for sparkle, and swimmers see a pool as shallower than it is because of refraction.

Some points cause confusion. All angles in Snell's law are measured from the normal, which is the line perpendicular to the surface, and not from the surface. The frequency of the light does not change when it crosses a boundary, only the speed and the wavelength do. The index also depends a little on wavelength, which is why a prism separates white light into colors. And total internal reflection needs two conditions, not one: the light must be heading into a lower-index medium, and the angle must be beyond the critical angle.

The three modes cover the usual tasks. The first converts between n and v and lists common materials. The second solves Snell's law for the refraction angle, reports the critical angle and draws the rays. The third works backwards from two measured angles to identify an unknown material. For the speed of light itself, see the speed of light calculator, and for image formation by curved mirrors, the mirror equation calculator.

📐 Formula

n = c / v    n1 sin θ1 = n2 sin θ2    sin θc = n2 / n1
n = index of refraction (no unit). c = 299,792,458 m/s, the speed of light in vacuum. v = speed of light in the material.
θ1, θ2 = angles of the incident and refracted rays, measured from the normal to the surface.
θc = critical angle, which exists only when n1 is larger than n2. If n1 sin θ1 / n2 is greater than 1, the light is totally reflected.
Wavelength in the medium: λ = λ0 / n, while the frequency f = c / λ0 stays the same.
Unknown index: n2 = n1 sin θ1 / sin θ2.
Example: n = 1.5 gives v = 299,792,458 / 1.5 = 1.9986 × 108 m/s.

📖 How to Use This Calculator

Steps

1
Choose a mode. Use n and speed to convert an index into a speed or back, Snell's law to find the refraction angle, or Find n from angles to identify an unknown medium.
2
Enter the values. Type the index or the speed (choose what you know and the unit first), or the two indices and the angle of incidence. Pick a material from the list if you want a standard value.
3
Read the results. The calculator gives n, v, the refraction angle, the critical angle and the bending direction. If the ray cannot leave, it says total internal reflection.
4
Check the diagram and chart. The ray diagram shows the incident, refracted and reflected rays. The chart plots the refraction angle against the incidence angle, with the critical angle marked.

💡 Example Calculations

Example 1 — Speed of Light in Glass

Glass with n = 1.5, and green light of vacuum wavelength 589 nm

1
v = c / n = 299,792,458 / 1.5 = 199,861,639 m/s = 1.9986 × 108 m/s, which is 66.67% of c.
2
Time to cross 1 m = n / c = 5.0035 ns, against 3.3356 ns in vacuum.
3
λ = 589 / 1.5 = 392.67 nm. The frequency is c / 589 nm = 508.99 THz on both sides.
v = 1.9986 × 108 m/s, λ = 392.67 nm
Try this example →

Example 2 — Index From a Measured Speed

Light travels at 2.25 × 108 m/s in a liquid

1
n = c / v = 299,792,458 / 225,000,000 = 1.3324.
2
The speed is 2.25 / 2.998 = 75.05% of c, close to water (n = 1.333).
3
Time to cross 1 m = 1.3324 / c = 4.4444 ns.
n = 1.3324
Try this example →

Example 3 — Air Into Glass

A ray in air (n = 1) hits glass (n = 1.5) at 30° from the normal

1
sin θ2 = 1 × sin 30° / 1.5 = 0.5 / 1.5 = 0.33333.
2
θ2 = arcsin(0.33333) = 19.471°, bending toward the normal.
3
Deviation = 30 − 19.471 = 10.529°. There is no critical angle going into a denser medium.
Angle of refraction = 19.471°
Try this example →

Example 4 — Total Internal Reflection in Glass

A ray inside glass (n = 1.5) meets the air boundary at 60°

1
Critical angle = arcsin(1 / 1.5) = 41.810°.
2
sin θ2 = 1.5 × sin 60° / 1 = 1.29904, which is greater than 1.
3
No refracted ray exists, because 60° is beyond 41.81°. All of the light reflects back into the glass.
Result = Total internal reflection, critical angle = 41.810°
Try this example →

Example 5 — Identify an Unknown Block

A ray from air at 45° refracts to 28.1° inside a transparent block

1
n2 = n1 sin θ1 / sin θ2 = 1 × sin 45° / sin 28.1° = 0.70711 / 0.47100.
2
n2 = 1.5013, which matches crown glass.
3
The speed in the block is c / 1.5013 = 1.9970 × 108 m/s.
n2 = 1.5013
Try this example →

Example 6 — Water to Air

A ray in water (n = 1.333) reaches the surface at 40°

1
sin θ2 = 1.333 × sin 40° / 1 = 0.85684.
2
θ2 = arcsin(0.85684) = 58.963°, bending away from the normal.
3
The critical angle is arcsin(1 / 1.333) = 48.607°, and 40° is below it, so the ray does escape.
Angle of refraction = 58.963°, critical angle = 48.607°
Try this example →

❓ Frequently Asked Questions

What is the formula for the index of refraction?+
The index of refraction is n = c / v, where c = 299,792,458 m/s is the speed of light in vacuum and v is the speed of light in the material. Glass with n = 1.5 slows light to 1.9986 x 10^8 m/s, two thirds of c.
How do you calculate the speed of light in a medium?+
Divide the speed of light in vacuum by the refractive index: v = c / n. In water, n = 1.333 gives v = 2.249 x 10^8 m/s, about 75 percent of c.
What is Snell's law?+
Snell's law states n1 sin(theta1) = n2 sin(theta2), where theta1 and theta2 are measured from the normal. Light entering glass (n = 1.5) from air at 30 degrees continues at 19.47 degrees, bending toward the normal.
What is the critical angle and how is it calculated?+
The critical angle is the incidence angle in the denser medium at which the refracted ray runs along the surface. It is theta_c = arcsin(n2 / n1). For glass to air it is arcsin(1/1.5) = 41.81 degrees; for water to air it is 48.61 degrees.
When does total internal reflection occur?+
It occurs when light goes from a higher index to a lower index and the angle of incidence is larger than the critical angle. Then sin(theta2) would be above 1, so no refracted ray exists and all the light is reflected. Optical fibers rely on this.
Does light bend toward or away from the normal?+
Toward the normal when it enters a medium with a higher index, and away from the normal when it enters a medium with a lower index. If the indices are equal, it does not bend.
Can the index of refraction be less than 1?+
For visible light in ordinary transparent materials it is 1 or more. Values slightly below 1 occur for X-rays, where the phase velocity can exceed c without breaking relativity. This calculator is for the ordinary case n of 1 or more.
What is the refractive index of water, glass and diamond?+
Typical values near 589 nm are about 1.333 for water, 1.5 to 1.65 for glass depending on the type, and 2.417 for diamond. The materials table on this page lists several more with the speed of light in each.
Why does the wavelength change but not the frequency?+
The frequency is fixed by the source, and it must be the same on both sides of the boundary. Since v = f lambda and v falls to c / n, the wavelength becomes lambda0 / n. Green light at 589 nm in vacuum has a wavelength of 392.7 nm in glass with n = 1.5.
How do you find the refractive index from two angles?+
Rearrange Snell's law to n2 = n1 sin(theta1) / sin(theta2). A ray going from air at 45 degrees to 28.1 degrees in a block gives n2 = 1.5013, which is crown glass.
Does the angle of incidence of 0 degrees bend the light?+
No. A ray along the normal has sin(theta1) = 0, so sin(theta2) = 0 as well and the ray goes straight through, although it still slows down or speeds up and part of it is reflected.

What is the formula for the index of refraction?

The index of refraction is n = c / v, where c = 299,792,458 m/s is the speed of light in vacuum and v is the speed of light in the material. Glass with n = 1.5 slows light to 1.9986 x 10^8 m/s, two thirds of c.

How do you calculate the speed of light in a medium?

Divide the speed of light in vacuum by the refractive index: v = c / n. In water, n = 1.333 gives v = 2.249 x 10^8 m/s, about 75 percent of c.

What is Snell's law?

Snell's law states n1 sin(theta1) = n2 sin(theta2), where theta1 and theta2 are measured from the normal. Light entering glass (n = 1.5) from air at 30 degrees continues at 19.47 degrees, bending toward the normal.

What is the critical angle and how is it calculated?

The critical angle is the incidence angle in the denser medium at which the refracted ray runs along the surface. It is theta_c = arcsin(n2 / n1). For glass to air it is arcsin(1/1.5) = 41.81 degrees; for water to air it is 48.61 degrees.

When does total internal reflection occur?

It occurs when light goes from a higher index to a lower index and the angle of incidence is larger than the critical angle. Then sin(theta2) would be above 1, so no refracted ray exists and all the light is reflected. Optical fibers rely on this.

Does light bend toward or away from the normal?

Toward the normal when it enters a medium with a higher index, and away from the normal when it enters a medium with a lower index. If the indices are equal, it does not bend.

Can the index of refraction be less than 1?

For visible light in ordinary transparent materials it is 1 or more. Values slightly below 1 occur for X-rays, where the phase velocity can exceed c without breaking relativity. This calculator is for the ordinary case n of 1 or more.

What is the refractive index of water, glass and diamond?

Typical values near 589 nm are about 1.333 for water, 1.5 to 1.65 for glass depending on the type, and 2.417 for diamond. The materials table on this page lists several more with the speed of light in each.

Why does the wavelength change but not the frequency?

The frequency is fixed by the source, and it must be the same on both sides of the boundary. Since v = f lambda and v falls to c / n, the wavelength becomes lambda0 / n. Green light at 589 nm in vacuum has a wavelength of 392.7 nm in glass with n = 1.5.

How do you find the refractive index from two angles?

Rearrange Snell's law to n2 = n1 sin(theta1) / sin(theta2). A ray going from air at 45 degrees to 28.1 degrees in a block gives n2 = 1.5013, which is crown glass.

Does the angle of incidence of 0 degrees bend the light?

No. A ray along the normal has sin(theta1) = 0, so sin(theta2) = 0 as well and the ray goes straight through, although it still slows down or speeds up and part of it is reflected.