Tangent Calculator
The tangent of an angle compares the side opposite it with the side next to it in a right triangle. Enter an angle in degrees or radians and the calculator returns the tangent, the reciprocal cotangent and the matching grade.
| Tangent | |
| Cotangent (1 / tangent) | |
| Grade (tangent x 100) |
Values are rounded to 4 decimal places, and grade to 2. The tangent is undefined at 90 degrees and at every odd multiple of 90 after it, because those angles sit where the adjacent side has zero length.
All calculations happen in your browser, and no data is uploaded.
Enter an angle in degrees or radians and get its tangent, cotangent and equivalent grade, with the unit circle logic and worked examples below.
Key takeaways
- Tangent is opposite over adjacent, so it can reach any value, unlike sine and cosine which stop at 1
- Key values: tan(30) is 0.5774, tan(45) is 1, tan(60) is 1.7321 and tan(0) is 0
- Tangent repeats every 180 degrees, so tan(210) equals tan(30)
- tan(90) is undefined: the adjacent side shrinks to zero and the ratio blows up
- Grade is the tangent times 100, and a 1:12 ADA ramp works out to 8.33 percent
On this page
- What the tangent of an angle tells you
- How to use this calculator
- The formula, and the unit circle picture behind it
- Worked examples: ramps, roofs and sightlines
- Reading grade and pitch from the tangent
- Asymptotes: why tan(90 degrees) does not exist
- Tangent next to sine and cosine, and the cotangent
- Common tangent mistakes
What the tangent of an angle tells you
Tangent answers a stacking question: for every unit you move across, how far do you climb? Pick one of the two sharp angles in a right triangle. The side that touches the angle, other than the hypotenuse, is the adjacent side, and the side across from it is the opposite side. Divide the opposite by the adjacent and you have the tangent.
Sine and cosine stay boxed between minus 1 and 1 because they compare a leg against the longest side. Tangent compares the two legs instead, so nothing caps it. At 45 degrees the legs are equal and the ratio is 1. At 89 degrees the opposite leg dwarfs the adjacent one and the ratio runs into the hundreds. That open range is what makes tangent the natural ratio for slopes and grades.
The table below lists the values worth knowing cold. Every one of them comes from triangles you can sketch in a minute.
| Angle | Tangent | Where it comes from |
|---|---|---|
| 0 degrees | 0 | the opposite side has zero length |
| 30 degrees | 0.5774 | 1 over the square root of 3 |
| 45 degrees | 1 | isosceles right triangle, equal legs |
| 60 degrees | 1.7321 | the square root of 3 |
| 90 degrees | undefined | the adjacent side has zero length |
Notice the pairing: tan(30) and tan(60) are reciprocals, and their product is exactly 1.
How to use this calculator
Type an angle, choose degrees or radians, and press Calculate. The tool returns three lines. The first is the tangent, rounded to four decimals. The second is the cotangent, which is 1 divided by the tangent and reads undefined when the tangent is 0. The third is the grade, the tangent times 100, the number builders and road engineers use every day.
An empty box shows the message Enter an angle to see its tangent, so a blank never pretends to be a result of zero. Typing something that is not a number earns a clear note as well. The calculator accepts negatives, decimals and angles larger than a full turn: tan(400 degrees) lands on the same value as tan(40 degrees), because the extra 360 changes nothing.
Try 45 first. The tool should show a tangent of 1, a cotangent of 1 and a grade of 100. If those three lines look right, the unit selector is set the way you expect and the rest of the page will behave the same way.
The formula, and the unit circle picture behind it
The definition fits in one line: tan(angle) = opposite / adjacent. On the unit circle, where the hypotenuse is 1, that same ratio becomes sin divided by cos. The point at your angle has coordinates (cos, sin), and the tangent is the height of that point divided by its horizontal position, which is the slope of the line from the origin through it.
This picture explains the famous period of 180 degrees. Two angles 180 degrees apart put their points on the same line through the origin, at opposite ends, and opposite ends of one line share a slope. So tan(200 degrees) equals tan(20 degrees), and tan(390 degrees) equals tan(30 degrees), with no extra work.
| Identity | What it says | Quick check |
|---|---|---|
| tan = sin / cos | tangent is the ratio of the other two functions | at 30 degrees, 0.5 / 0.866 = 0.5774 |
| tan(x + 180) = tan(x) | the pattern repeats every half turn | tan(210) = tan(30) = 0.5774 |
| tan x cot = 1 | cotangent is the reciprocal | 0.5774 x 1.7321 = 1 |
| tan(90 - x) = cot(x) | complementary angles swap the ratio | tan(60) = cot(30) = 1.7321 |
Radians behave the same way with a period of pi instead of 180, and the OpenStax Algebra and Trigonometry chapter on angles works through that conversion in detail.
Worked examples: ramps, roofs and sightlines
Example 1, a driveway grade. A driveway rises 2 feet over a 40 foot run. The tangent of the angle it makes with the ground is 2 / 40 = 0.05, and the grade is 0.05 x 100 = 5 percent. The angle itself is the arctangent of 0.05, about 2.9 degrees, gentle enough that you would barely feel it underfoot.
Example 2, a shed roof. A plan calls for a 3:12 pitch, which means 3 inches of rise for every 12 inches across. The tangent of the roof angle is 3 / 12 = 0.25, the grade is 25 percent, and the angle is arctan(0.25), about 14 degrees. A carpenter who knows the tangent can set the saw from the ratio alone.
Example 3, a flagpole. You stand 50 feet from the base and measure 18.4 degrees up to the top. The height above eye level is 50 x tan(18.4) = 50 x 0.3333 = 16.7 feet. Add your own eye height of 5.3 feet and the pole stands about 22 feet tall. One angle and one distance replace any ladder.
Reading grade and pitch from the tangent
Grade is the tangent dressed for construction work. Take the tangent of the slope angle, multiply by 100, and you have percent grade. A 45 degree slope is a 100 percent grade, because it climbs exactly as much as it runs. The ramps guide from the US Access Board caps accessible ramp runs at 1:12, a rise of 1 unit for every 12 across, and 1 / 12 = 0.0833 works out to a grade of 8.33 percent.
The next table lines up the common ratios. Notice how small angle changes barely move the tangent at the bottom of the range and move it a lot near the top, which is why wheelchair ramps are specified in ratios rather than degrees.
| Ratio (rise:run) | Tangent | Grade | Angle |
|---|---|---|---|
| 1:48 (cross slope limit) | 0.0208 | 2.08 percent | about 1.2 degrees |
| 1:20 (flat enough to skip the ramp rules) | 0.05 | 5 percent | about 2.9 degrees |
| 1:12 (ADA ramp maximum) | 0.0833 | 8.33 percent | about 4.8 degrees |
| 3:12 (shed roof pitch) | 0.25 | 25 percent | about 14 degrees |
| 1:1 (equal legs) | 1 | 100 percent | 45 degrees |
Road signs use the same scale: a 6 percent downgrade means the road drops 6 feet for every 100 feet of run, a tangent of 0.06.
Asymptotes: why tan(90 degrees) does not exist
Set the angle to 89.9 degrees and the calculator returns about 572.96. At 89.99 degrees it returns about 5729.58. Nothing dramatic happened to the triangle; the adjacent leg keeps shrinking while the opposite leg stays put, and dividing by an ever smaller number sends the ratio upward with no ceiling. At exactly 90 degrees the adjacent side has length 0, and division by zero ends the story.
Mathematicians call the vertical walls at 90 degrees, 270 degrees and every 180 degrees after that asymptotes. The tangent curve sweeps up toward each wall, disappears, and reappears from the bottom on the other side. The same gaps fall at odd multiples of 90 degrees: 90, then 270, then 450 going up, and minus 90 going down.
Practically, this is why a vertical face is not labeled as an infinite grade on any sign you will ever read. Percent grade is defined from rise over run, and a vertical face has no run to divide by. When your angle lands on 90 or 270, the calculator shows undefined rather than a made up number, and the cotangent line keeps working, because cot(90) = cos(90) / sin(90) = 0.
Tangent next to sine and cosine, and the cotangent
Three functions, one triangle. Sine is opposite over hypotenuse, cosine is adjacent over hypotenuse, and tangent is the first divided by the second. If you know any two of the three values, the third follows. A triangle with sine 0.6 and cosine 0.8 has tangent 0.6 / 0.8 = 0.75, which is the signature of a 3:4:5 right triangle.
Cotangent runs the other way: cot = adjacent / opposite = 1 / tan. The two functions trade places at complementary angles, so tan(30) = cot(60) and cot(30) = tan(60). Where tangent explodes at 90 degrees, cotangent explodes at 0 and 180 degrees, which makes the pair handy for checking each other. The cotangent calculator on this site handles that side of the pair on its own page.
Choosing the right function for a problem is half the work. You have the rise and want the run? Divide the rise by the tangent. You have the run and want the rise? Multiply by the tangent. You have two sides and want the angle? Divide them in the order that matches the function, then take the inverse, which the arctan calculator on this site does directly.
Common tangent mistakes
Five traps account for nearly every bad tangent answer, and each one leaves a recognizable fingerprint.
| Trap | What it looks like | Repair |
|---|---|---|
| Working in the wrong unit | 30 radians returns minus 6.4053 | set the selector to match the number |
| Upside down ratio | run divided by rise instead of rise by run | TOA: opposite over adjacent |
| Hunting for a number at 90 degrees | the line reads undefined at 90 and 270 | odd multiples of 90 have no tangent |
| Believing tangent caps at 1 | tan(60) = 1.7321, far above 1 | only sine and cosine cap at 1 |
| Losing a minus sign | tan(135) = minus 1, not 1 | second quadrant tangents are negative |
Unit mode causes the most silent failures. A tangent of 30 radians comes back as minus 6.4053, a number that looks reasonable in isolation, and nothing on screen says radians were used. Check the selector first when a slope looks absurd. Premature rounding is the other culprit: carrying 0.5774 into a chain of multiplications can shift the last digit, so keep full precision until the final step.
Frequently asked questions
What is tan(30 degrees)?
About 0.5774. A 30 degree triangle has an opposite side of 1 and an adjacent side of the square root of 3, so the ratio is 1 / 1.7321 = 0.5774.
What is tan(45 degrees)?
Exactly 1. At 45 degrees the opposite and adjacent sides are the same length, so one divided by the other gives 1, and the grade equivalent is 100 percent.
What is tan(60 degrees)?
About 1.7321, the square root of 3. In a 30:60:90 triangle the leg opposite the 60 degree angle is twice the short leg, which is where the factor comes from.
Why is tan(90) undefined?
Because the adjacent side has zero length at 90 degrees, and the formula divides by it. The ratio grows without limit as the angle approaches 90, so no number describes the exact moment.
What is the tangent of 0 degrees?
0. The opposite side has no length when the angle closes flat, so 0 divided by any adjacent length is 0. The cotangent there is undefined, the mirror of the 90 degree case.
How do I convert grade percent to an angle?
Divide the percent by 100 to get the tangent, then take the arctangent. An 8.33 percent grade is a tangent of 0.0833, and arctan(0.0833) is about 4.8 degrees.
What angle is a 1:12 ramp?
About 4.76 degrees. The rise over run is 1 / 12 = 0.0833, and the arctangent of that value lands between 4.7 and 4.8 degrees, the ADA maximum for new ramp runs.
Does the tangent repeat, and how often?
Every 180 degrees, half the period of sine and cosine. Tan(210) equals tan(30), and tan(390) equals tan(30) as well, because each extra half turn lands the point on the same line through the origin.
Can tangent be negative?
Yes. Tangent is negative wherever sine and cosine disagree in sign, which covers 90 through 180 degrees and 270 through 360 degrees. Tan(135) is minus 1 and tan(150) is about minus 0.5774.
What is the difference between tan and arctan?
Tan takes an angle and returns a ratio, while arctan takes a ratio and returns the angle between minus 90 and 90 degrees. To recover a ramp angle from an 8.33 percent grade, compute arctan(0.0833).
How is tangent used to find the height of a building?
Stand a known distance from the base, measure the angle up to the top, and multiply the distance by the tangent. From 50 feet at 18.4 degrees, the height above eye level is 50 x 0.3333, about 16.7 feet.
What is a 10 percent grade in degrees?
About 5.7 degrees. A 10 percent grade is a tangent of 0.10, and the arctangent of 0.10 works out to 5.71 degrees, a slope you feel on a bike long before it looks steep on paper.
What is the cotangent of 30 degrees?
About 1.7321. Cotangent is 1 divided by the tangent, and 1 / 0.5774 = 1.7321, the same value as tan(60), because complementary angles swap the two functions.
Spotted a wrong number or a broken result?
More Math tools
Fee schedules, rates and rules change without notice. Always confirm important figures with the official source before you rely on them.