Tangent of an angle
The tangent of 45° is 1: enter an angle in degrees or radians and get its tangent, with the angle shown in both units. At 90°, 270° and other odd multiples of 90° you are told it is undefined, not shown a huge number. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Angle
- 45
- Degrees
- 45 degrees
- Radians
- 0.7853981634
- Tangent
- 1
- Expression
- tan(45°)
The tangent of an angle is the ratio of the opposite side to the adjacent side in a right triangle, or equivalently sine divided by cosine on the unit circle. This calculator accepts a finite angle in degrees or radians and returns tan of that measure. Most programming libraries expose only a tangent of radians, so a student, surveyor, CNC script, or slope tool that thinks in degrees must convert first or every rise-over-run ratio comes out wrong. Tangent is undefined at odd multiples of ninety degrees — ninety, two hundred seventy, minus ninety, and the matching radian measures such as pi over two — because cosine is zero there and the vertical line never meets the tangent line.
What tangent of an angle means and where it is undefined
Tangent is the odd, one-hundred-eighty-degree-periodic function that maps an angle to the signed rise-over-run of the corresponding ray. In a right triangle that is opposite over adjacent; on the unit circle it is sine divided by cosine, which is the slope of the line from the origin through the point. Cosine is zero at odd multiples of ninety degrees — ninety, two hundred seventy, four hundred fifty, minus ninety, minus two hundred seventy — and at the matching radian measures pi over two, three pi over two, and so on.
Everywhere else tangent is defined. Programming libraries implement the analytic tangent of a real argument in radians, so a degree measure must be converted with theta times pi over one hundred eighty before evaluation. Forgetting that conversion is a common classroom bug: tangent of forty-five radians is about one point six two, not one.
Special angles have textbook exact values students expect without a trail of nines: tangent of zero is zero, tangent of thirty degrees is one over root three, tangent of forty-five degrees is one, and tangent of sixty degrees is root three. Negative degrees and angles larger than a full turn remain valid; they are reduced only when matching those special values or when testing the undefined set. Related searches such as a six-function sine-cosine-tangent calculator, an arctangent that returns an angle, or a hyperbolic tangent, are different intents.
Here the contract is the scalar tangent of one finite angle in degrees or radians.
What you enter and what you get back
Unit defaults to degrees so a classroom angle can be sent as a single number. If unit is present it must be one of the two published tokens; any other string fails. On success the body echoes the cleaned angle and the resolved unit, returns degrees and radians so callers never have to convert again, and returns tangent as the primary result.
Example: angle forty-five in degrees yields tangent one, because forty-five degrees is pi over four radians and the tangent of that argument is exactly one. Example: angle thirty yields one over root three. Example: angle zero yields zero.
Example: angle pi over four with unit radians yields one. Example: angle ninety, two hundred seventy, or minus ninety fails because those are odd multiples of ninety degrees and tangent is undefined. For all six trigonometric functions, or for the inverse that recovers an angle from a tangent, use the dedicated pages that match those searches.
Where a tangent-of-an-angle calculator earns its keep
Classrooms and tutoring platforms use a tangent of an angle calculator so learners can check tan of an arbitrary classroom measure without mixing degrees and radians or copying a calculator mode they cannot see. Exam generators need a deterministic oracle that marks odd multiples of ninety degrees as undefined instead of silently returning Infinity, which many language runtimes do and which a buggy grader might treat as a number. Failed validation does not consume balance.
Keep requests small, pin the rounded tangent in tests, and you get a reproducible tan of an angle for homework, LMS plugins, and edge workers without standing up symbolic math infrastructure of your own. Related searches such as inverse tangent, hyperbolic tangent, or a full sine-cosine-tangent table are different problems and are served by other pages; this contract stays on tangent of one finite angle so the landing matches what a student actually types when the question is simply tan of this many degrees or radians.
What you can do with it
Classroom and homework checks
Let students submit an angle in degrees or radians and verify tan(θ), including tan(0°)=0, tan(30°)=1/√3, and tan(45°)=1, against textbook methods.
Exam and LMS auto-grading
Mark tangent items with a deterministic oracle that rejects odd multiples of 90° as undefined and never invents Infinity as a successful tangent.
Slopes, headings, and resolved components
Convert a degree heading or pitch to the opposite-over-adjacent ratio in surveying, roof layout, robotics, or game scripts without importing a full computer-algebra library.
FAQ
How do I compute the tangent of an angle in degrees or radians?
Set unit to degrees (the default) or radians.
Why is tangent undefined at 90 degrees?
At 90°, 270°, −90°, and every other odd multiple of 90°, cosine is zero, so sine divided by cosine has no real value.
Does the calculator accept 0° and 180°?
Yes. Tangent of 0° and of 180° is 0. Unlike a six-function calculator that must also refuse those angles because cosecant and cotangent blow up, this page only refuses odd multiples of 90°.
What is the exact tangent of 30, 45 and 60 degrees?
The tangent of 30° is 1/√3, of 45° it is exactly 1 and of 60° it is √3. The calculator gives these textbook values without a trail of nines, also for negative angles or angles beyond a full turn that land on them.
Why does tan 45 give 1.62 instead of 1?
Because the 45 was read as radians: the tangent of 45 radians is about 1.62. If your angle is in degrees, keep degrees selected, which is the default, and the tangent of 45° comes out as 1.
Related tools
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/math/tangent-angle \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"angle":45}'const res = await fetch("https://api.kit.forhosting.com/math/tangent-angle", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"angle": 45
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/tangent-angle",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"angle": 45
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/tangent-angle", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"angle":45}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"angle":45}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/tangent-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
{
"angle": 45
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.tangent_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. |
Technical notes
Those inputs fail with invalid_input instead of a huge floating-point stand-in.
What tangent of an angle means and where it is undefined
When the adjacent side is zero, or equivalently when cosine is zero, the ratio has no real value: the vertical line through that unit-circle point is parallel to the geometric tangent line and they never meet. This calculator refuses those inputs with invalid_input instead of returning a huge floating-point number that a homework script might treat as a real answer.
Input contract, response shape, and error behaviour
POST a JSON body with the required field angle, a finite real number, and an optional unit that is either degrees or radians. The angle field may arrive as a JSON number or as a numeric string in decimal or scientific notation; aliases theta, x, and value are accepted when angle is omitted. Missing fields, empty strings, non-numeric text, NaN, and Infinity fail with invalid_input naming the field and are not billed. A formula string restates tan of theta equals sine over cosine, a compact expression such as tan(45°), and a one-line message complete the payload. Pair the payload with your own labels; this endpoint does not emit plots, a sine or cosine companion, or a step-by-step lesson beyond the formula field.
Where a tangent-of-an-angle calculator earns its keep
Surveying, robotics, roof-pitch, and game scripts store headings or slopes in degrees and still need the opposite-over-adjacent ratio for a rise, a sprite offset, or a resolved force; calling a tiny parse API avoids pulling a computer-algebra system for one conversion and one tangent.
Technical questions
What happens if I send π/2 radians?
π/2 radians is 90 degrees, an odd multiple of 90°, so tangent is undefined and the task fails with invalid_input. π/4 radians is accepted and returns tangent 1.
What does the tangent of an angle calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.