Tangent Calculator

Enter an angle in degrees or radians to find its tangent, tan θ.

Updated

Angle unit
Enter to calculate Esc to clear

Tangent Calculator

Our Tangent Calculator finds tan θ for any angle in degrees or radians. Type the angle and the answer appears straight away to 10 decimal places, with the exact value for special angles (such as √3 for 60°), the angle in the other unit, the quadrant, and sin θ and cos θ. It tells you clearly when the tangent is undefined, at 90°, 270° and similar angles, instead of showing a huge meaningless number, and it gives tan 45° as exactly 1 rather than 0.9999999999999999.

Quick answer

The tangent of an angle is the opposite side divided by the adjacent side in a right triangle, which is the same as sin θ ÷ cos θ. For example, tan 45° = 1. Enter any angle above and the calculator shows tan θ instantly.

  • Formula: tan θ = opposite ÷ adjacent = sin θ ÷ cos θ
  • Key values: tan 0° = 0, tan 30° ≈ 0.5774, tan 45° = 1, tan 60° ≈ 1.7321
  • Undefined: at 90°, 270° and every 90° + k × 180°, where cos θ = 0
  • Range and period: any real number, repeating every 180° (π)

What Is Tangent?

Tangent is one of the three main trigonometric functions, with sine and cosine. In a right triangle it compares the two shorter sides: the one opposite the angle and the one next to it.

tan θ = opposite ÷ adjacent
tan θ = sin θ ÷ cos θ

SOH: sin = opp / hyp
CAH: cos = adj / hyp
TOA: tan = opp / adj

Because tangent divides by cos θ, it has no value where cos θ = 0. Everywhere else it is defined, and unlike sine and cosine it is not limited to the range −1 to 1: it grows without limit as the angle approaches 90°.

Tangent Table of Common Angles

AngleExactDecimal
0° (0)00
30° (π/6)√3/30.5774
45° (π/4)11
60° (π/3)√31.7321
90° (π/2)undefinedundefined
120° (2π/3)−√3−1.7321
135° (3π/4)−1−1
150° (5π/6)−√3/3−0.5774
180° (π)00

√3/3 is the same number as 1/√3. From 180° onwards the values repeat, because tangent has a period of 180°.

The Tangent Graph

Graph of y = tan(θ) from −90° to 270°: it repeats every 180°, passes through 0 at 0° and 180°, through 1 at 45°, and shoots off to infinity at the vertical asymptotes 90° and 270° and −90° 90° 180° 270° −90° −2 2 (45°, 1) asymptote
  • Period: the curve repeats every 180° (π radians).
  • Asymptotes: vertical lines at 90°, 270°, −90° and every 90° + k × 180°, where tan θ is undefined.
  • Zeros: tan θ = 0 at 0°, 180° and every multiple of 180°.
  • Always rising: between two asymptotes the curve climbs from −∞ to +∞.
  • Odd function: tan(−θ) = −tan θ.

Tangent and Slope

The tangent of an angle is the slope of a line at that angle: how far it rises for every 1 unit across. That makes it the link between angles and gradients, pitches and grades:

Angletan θ (slope)As a grade
2.86°0.055%
4.76°0.0833 (1:12)8.3%
26.57°0.5 (6/12 roof)50%
45°1100%

A 100% grade is a 45° slope, not a vertical wall. To go from a slope back to an angle, use the inverse tangent: θ = tan−1(rise ÷ run).

Tangent Rules and Identities

  • Quotient: tan θ = sin θ ÷ cos θ.
  • Pythagorean: 1 + tan2θ = sec2θ.
  • Negative angle: tan(−θ) = −tan θ.
  • Half turn: tan(θ + 180°) = tan θ.
  • Complement: tan(90° − θ) = cot θ = 1 ÷ tan θ.
  • Double angle: tan 2θ = 2 tan θ ÷ (1 − tan2θ).
  • Sum: tan(A + B) = (tan A + tan B) ÷ (1 − tan A tan B).

Worked Examples

Height of a tree. From 20 m away, the top of a tree is at a 35° angle of elevation:

height = 20 × tan 35°
= 20 × 0.7002
≈ 14.0 m

Angle of a ramp. A ramp rises 1 m over 12 m of ground:

θ = tan⁻¹(1 ÷ 12)
≈ 4.76°

Radian inputs. tan(0.5) ≈ 0.5463, tan(1.2) ≈ 2.5722 and tan(2) ≈ −2.1850. 2 radians is about 115°, in quadrant II, so its tangent is negative.

Tangent in Excel and Code

Tooltan 45°
Excel / Google Sheets=TAN(RADIANS(45))
Pythonmath.tan(math.radians(45))
JavaScriptMath.tan(45 * Math.PI / 180)
Scientific calculatorDEG mode, then tan 45

These functions expect radians, so =TAN(45) gives about 1.6198, the tangent of 45 radians. They also return 0.9999999999999999 for tan 45° and a huge number (about 1.63 × 1016) for tan 90° instead of an error, because π cannot be stored exactly.

Common Mistakes

  • Wrong angle mode. tan 45 is 1 in degrees but about 1.6198 in radians.
  • Trusting a huge result at 90°. A value like 1.63 × 1016 means the tangent is undefined there.
  • Reading tan⁻¹ as 1/tan. tan−1(1) = 45° (arctan), while 1 ÷ tan θ is cot θ.
  • Treating a grade as an angle. A 100% grade is 45°, and a 10% grade is about 5.71°, not 10°.
  • Swapping the sides. Tangent is opposite ÷ adjacent; adjacent ÷ opposite is the cotangent.

Key Terms

Opposite
The side across from the angle θ.
Adjacent
The side next to θ that is not the hypotenuse.
Asymptote
A line the graph approaches but never reaches; tangent has them at 90° + k × 180°.
Slope
Rise ÷ run, equal to the tangent of the angle of the line.
Cotangent
The reciprocal of tangent: cot θ = 1 ÷ tan θ.
Arctan
The inverse of tangent, written tan⁻¹ or atan.

How to Use the Tangent Calculator

  1. Enter the angle. Type the angle θ, for example 45, or press one of the angle buttons (30°, 45°, 60° and 90° in degrees, π/6, π/4, π/3 and π/2 in radians). In radians you can type a decimal such as 0.5 or a multiple of π such as pi/4 or 3π/4.
  2. Choose degrees or radians. Pick Degrees (°) or Radians (rad). Typing 45° or 0.5 rad also sets the unit for that angle.
  3. Read and copy the result. tan θ appears as you type, to 10 decimal places, with the exact value where there is one (for example tan(60°) = √3 ≈ 1.7320508076). The table below shows the angle in the other unit, the quadrant, sin θ and cos θ. At 90°, 270° and similar angles the tangent is undefined and the calculator says so. Press Copy to copy the result, or Clear or Esc to start again.

Example: enter 135 in degrees and the result is −1, with the note that 135° is in quadrant II with a reference angle of 45°, and 135° = 3π/4 rad.

Who Can Use This Calculator?

Students and TeachersRight triangles, slopes and trig homework
Builders and SurveyorsRoof pitches, ramp angles and heights from a distance
EngineersRoad grades, gradients and force directions
Programmers and Game DevelopersAiming, line slopes and camera angles

Frequently Asked Questions (FAQs)

What is the tangent of an angle?

In a right triangle, the tangent of an angle θ is the side opposite θ divided by the side next to it: tan θ = opposite ÷ adjacent. For any angle it equals sin θ ÷ cos θ. It also gives the slope of a line: a line at angle θ to the horizontal rises tan θ units for every 1 unit across.

What is tan 0°, tan 30°, tan 45°, tan 60° and tan 90°?

tan 0° = 0, tan 30° = √3/3 ≈ 0.5774, tan 45° = 1 and tan 60° = √3 ≈ 1.7321. tan 90° is undefined, because cos 90° = 0 and you cannot divide by zero.

Why is tan 90° undefined?

tan θ = sin θ ÷ cos θ, and cos 90° = 0, so tan 90° would mean dividing 1 by 0. As θ gets closer to 90° the tangent grows without limit (tan 89.9° ≈ 573), and just past 90° it is hugely negative. The graph has a vertical asymptote there, and the same happens at 270°, −90° and every 90° + k × 180°.

Can tangent be greater than 1?

Yes. Unlike sine and cosine, tangent can be any real number. It is 1 at 45°, about 1.7321 at 60°, about 5.6713 at 80° and about 573 at 89.9°. Angles below 45° give values between 0 and 1.

When is tangent negative?

Tangent is positive in quadrants I and III (where sine and cosine have the same sign) and negative in quadrants II and IV. For example tan 120° ≈ −1.7321 and tan 135° = −1.

What is the period of the tangent function?

180°, or π radians, half the period of sine and cosine. Adding 180° gives the same value: tan 225° = tan 45° = 1.

How do you find an angle from a slope?

Use the inverse tangent (arctan): angle = tan−1(rise ÷ run). A 1 in 12 wheelchair ramp has a slope of 1/12, so its angle is tan−1(1/12) ≈ 4.76°. A road with a 5% grade rises at tan−1(0.05) ≈ 2.86°.

Is tan⁻¹ the same as 1/tan?

No. tan−1(x) usually means arctan, the angle whose tangent is x: tan−1(1) = 45°. The reciprocal 1 ÷ tan θ is a different function called cotangent, cot θ: cot 45° = 1 and cot 60° ≈ 0.5774.

Why does my calculator or code give 0.9999999999999999 for tan 45°?

Programs work in radians and cannot store π exactly, so Math.tan(Math.PI / 4) in JavaScript and math.tan(math.pi / 4) in Python return 0.9999999999999999, and tan(π/2) gives about 1.63 × 1016 instead of an error. This calculator works in degrees for special angles, so tan 45° is exactly 1 and tan 90° is reported as undefined.

Is the Tangent Calculator free?

Yes. It is completely free, needs no sign-up, and can be used as many times as you like.

Try our Tangent Calculator to find tan θ for any angle in degrees or radians instantly.