Critical angle total internal reflection calculator
This critical angle calculator finds the boundary angle for total internal reflection when light travels from a medium with a higher refractive index into one with a lower refractive index.
Run — free
Enter the incident-medium index as n1 and the second-medium index as n2. The calculator evaluates the inverse sine of n2 divided by n1, then reports the result in radians and degrees. It also checks the physical requirement that n1 must be greater than n2, so reversed, equal, missing, nonfinite, or nonpositive index values produce a clear input error instead of a misleading angle.
Understand when a critical angle exists
Total internal reflection can occur only when a ray travels from a medium with a larger refractive index into a medium with a smaller refractive index. In this calculator, n1 identifies the incident medium and n2 identifies the medium on the other side of the boundary. The required relationship is therefore n1 greater than n2. As the angle of incidence grows, measured from the normal to the surface, the refracted ray bends farther away from that normal. At one particular incidence angle, the theoretical refracted angle reaches ninety degrees and the ray runs along the boundary. That incidence value is the critical angle. For still larger incidence angles, ordinary refraction no longer supplies a real transmitted angle, and ideal total internal reflection occurs. The calculator deliberately rejects equal indices because no refractive contrast exists, and it rejects a smaller n1 because that direction bends light toward the normal rather than producing this threshold. This validation is important: an inverse-sine button may still return a number for poorly labelled values, but that number would not describe a valid total-internal-reflection boundary for the stated direction of travel. Always assign the media according to the actual direction of the incoming light before interpreting the answer.
Apply the inverse-sine relationship correctly
The calculation follows directly from Snell's law at the limiting condition. First divide n2 by n1. Because a valid pair satisfies zero less than n2 less than n1, this ratio lies strictly between zero and one. Next take the inverse sine of the ratio to obtain the critical angle in radians: theta c equals arcsin of n2 over n1. Finally, multiply the radian result by one hundred eighty divided by pi to express the same angle in degrees. The response includes the validated indices, the intermediate ratio, and both angular units, making it straightforward to audit the arithmetic or feed the output into another step. Results are rounded to twelve decimal places to keep serialized output stable while retaining more precision than most instructional and engineering estimates require. Refractive index is dimensionless, but it depends on wavelength, temperature, and material conditions, so both input values should come from compatible references. This tool does not look up material properties or choose a wavelength for you. It performs the deterministic trigonometric step using exactly the two numerical indices supplied. If a source gives complex indices for absorbing materials, use a fuller optical model instead of this ideal real-index calculation.
Interpret and automate the result
A returned critical angle marks a threshold, not a guarantee that every incoming ray will reflect. The incidence angle must be measured inside medium one from the surface normal, and total internal reflection occurs only for angles greater than the reported value under the ideal interface assumptions. At exactly the critical angle, the limiting refracted ray is parallel to the interface. Surface roughness, absorption, coatings, curved geometry, scattering, and evanescent coupling can affect a real optical system, none of which are represented by this compact calculation. For classroom work, the degrees field is usually the most convenient result to compare with a diagram or answer key. For numerical software, the radians field can be passed directly to standard trigonometric functions without another unit conversion. The ratio field is useful for diagnosing swapped indices and checking the underlying data. Browser use is convenient for individual glass-to-air, water-to-air, prism, or fiber-interface checks. Automated workflows can call the API for $0.002 per item and receive consistent JSON with no network-dependent scientific service, random process, or model-generated estimate. Treat printed source indices as approximate measurements and round the displayed angle according to the precision of those inputs rather than assuming all returned decimal places are experimentally significant.
What you can do with it
Physics exercises
Check critical-angle calculations for textbook interfaces and compare the degree result with a worked solution.
Fiber and prism checks
Estimate the total-internal-reflection threshold for an ideal core boundary or optical prism before using a detailed simulation.
Automated optical worksheets
Generate deterministic radians, degrees, and index ratios for validated pairs in teaching or assessment software.
FAQ
What formula does the calculator use?
It uses theta c = arcsin(n2 / n1), where n1 is the incident medium and n2 is the lower-index second medium.
Why must n1 be greater than n2?
Total internal reflection requires light to travel from the higher-index medium toward the lower-index medium. Otherwise this critical-angle condition does not exist.
Is the angle returned in degrees or radians?
Both units are returned, together with the n2/n1 ratio used by the inverse-sine calculation.
Can I enter zero or a negative refractive index?
No. This ideal calculator requires two finite, positive real refractive indices and rejects other values as invalid input.
How much does an API calculation cost?
Each API item costs $0.002. The calculation is deterministic and does not call an external model or optics service.
For developers — API access
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.
API endpoint
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.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/trig/critical-angle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n1":1.5,"n2":1}'const res = await fetch("https://api.kit.forhosting.com/trig/critical-angle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n1": 1.5,
"n2": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/trig/critical-angle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n1": 1.5,
"n2": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/trig/critical-angle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n1":1.5,"n2":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n1":1.5,"n2":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/trig/critical-angle", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n1": 1.5,
"n2": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "trig.critical_angle",
"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.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |