Skip to content
Math

Tangent Calculator

Enter an angle in degrees, radians, gradians, or milliradians and get the tangent instantly, along with all six related trigonometric values and the inverse-tan (arctan) lookup. The calculator shows each step of the arithmetic and flags the asymptote points such as 90° and 270° where the tangent is undefined.

Your details

Forward: enter an angle to get tan(theta). Inverse: enter the tangent value to recover the angle via arctan.
The angle theta whose tangent you want. Negative angles are allowed.
Degrees: full turn = 360. Radians: full turn = 2pi. Gradians: full turn = 400. Milliradians: full turn = 2000pi (mrad).
Also compute sin, cos, cot, sec, and csc for the same angle alongside tan.
tan(theta)Defined
1
QuadrantI (sin+, cos+, tan+)
Angle in radians0.785398 rad
-11.43011.43590175
Angle (degrees)

tan(45°) = 1.

  • The angle is in quadrant I (sin+, cos+, tan+), which determines the signs of all six trig values.
  • Tangent is the sine divided by the cosine. On the unit circle it equals the y-coordinate over the x-coordinate at the angle.
  • Tangent repeats every 180° (pi radians), so tan(theta) = tan(theta + 180°). It is also an odd function: tan(-theta) = -tan(theta).
  • A positive tangent means the angle is in quadrant I (0°-90°) or quadrant III (180°-270°).

Next stepApply arctan to this value to recover the principal angle, or use the "tan(theta) to angle" mode above.

Formula

tan(θ)=sin(θ)cos(θ)=oppositeadjacent,θ=arctan(tanθ)\tan(\theta) = \dfrac{\sin(\theta)}{\cos(\theta)} = \dfrac{\text{opposite}}{\text{adjacent}}, \quad \theta = \arctan(\tan\theta)

Worked example

For theta = 45 deg: sin 45 deg = 0.707107 and cos 45 deg = 0.707107, so tan 45 deg = 1.000000. For theta = 60 deg: sin 60 deg = 0.866025, cos 60 deg = 0.500000, so tan 60 deg = sqrt(3) = 1.732051. Inverse example: arctan(1) = 45 deg (the principal angle between -90 deg and 90 deg).

What the tangent of an angle means

The tangent of an angle theta is defined as the ratio of its sine to its cosine: tan theta = sin theta divided by cos theta. In a right triangle this equals the length of the side opposite the angle divided by the side adjacent to it. On the unit circle, a point sits at coordinates (cos theta, sin theta), and the tangent is simply the y-coordinate divided by the x-coordinate, which also equals the slope of the line from the origin to that point. These two interpretations, the triangle ratio and the unit-circle slope, are equivalent and underpin every application from surveying to signal processing.

Four angle units: degrees, radians, gradians, and milliradians

Angles can be measured in four common units. Degrees split a full turn into 360 equal parts. Radians measure the arc on a unit circle: one full turn = 2 pi rad. Gradians (also called gon or grade) divide a full turn into 400 parts, so a right angle is exactly 100 grad. Milliradians are one-thousandth of a radian and are used in ballistics and surveying. To convert: multiply degrees by pi/180 to get radians; multiply degrees by 400/360 to get gradians; multiply radians by 1000 to get milliradians. Picking the wrong unit is the most frequent source of error, so confirm the selector matches your problem.

Where the tangent is undefined: vertical asymptotes

Tangent is undefined wherever cosine equals zero, because the formula divides by cos theta. That happens at 90 deg and 270 deg within one full turn, and more generally at every odd multiple of 90 deg (written 90 deg + 180k for integer k), which equals pi/2 + pi*k in radians or 100 + 200k in gradians. As the angle approaches one of these asymptote points the tangent grows without bound, racing toward positive infinity from one side and negative infinity from the other. The graph has a vertical break at each of these angles, and the calculator reports the result as Undefined rather than a misleadingly large number.

Inverse tangent (arctan): recovering an angle from its tangent

The inverse tangent function, written arctan or tan-1, takes a tangent value and returns the angle that produced it. Because tangent repeats every 180 degrees, each tangent value corresponds to infinitely many angles. The arctan function returns the unique principal angle between -90 deg and 90 deg (exclusive), and you add or subtract multiples of 180 deg to find every other angle with the same tangent. Switch the calculator to "tan(theta) to angle" mode, enter the tangent value, and choose the output unit you need. The principal angle, the radian equivalent, and the degree equivalent are all shown.

All six trigonometric values from one angle

Toggle "Show all 6 trig values" to compute the complete set alongside tan. Sine (sin) is the y-coordinate on the unit circle. Cosine (cos) is the x-coordinate. Cotangent (cot) is the reciprocal of tangent, equal to cos over sin. Secant (sec) is the reciprocal of cosine. Cosecant (csc) is the reciprocal of sine. The Pythagorean identities link them: sin squared + cos squared = 1, and 1 + tan squared = sec squared. Any one of the six values, together with the quadrant, completely determines the other five.

Periodicity, symmetry, and the CAST rule

Tangent has a period of 180 deg (pi radians), half the period of sine and cosine. Adding or subtracting 180 deg from an angle leaves its tangent unchanged. Tangent is also an odd function: tan(-theta) = -tan(theta). The CAST rule tells you which trig functions are positive in each quadrant: All in quadrant I, Sine only in quadrant II, Tangent only in quadrant III, Cosine only in quadrant IV. These facts let you reduce any angle to an equivalent principal value between -90 deg and 90 deg before computing.

Common tangent values, 0 to 360 degrees

Angle (deg)Angle (rad)Angle (grad)tan(theta)
0 deg00 grad0
30 degpi/633.33 grad0.5774 (1/sqrt(3))
45 degpi/450 grad1
60 degpi/366.67 grad1.7321 (sqrt(3))
90 degpi/2100 gradUndefined
120 deg2pi/3133.33 grad-1.7321
135 deg3pi/4150 grad-1
150 deg5pi/6166.67 grad-0.5774
180 degpi200 grad0
210 deg7pi/6233.33 grad0.5774
225 deg5pi/4250 grad1
240 deg4pi/3266.67 grad1.7321
270 deg3pi/2300 gradUndefined
315 deg7pi/4350 grad-1
360 deg2pi400 grad0

Exact and decimal tangents at key angles across a full turn. Gradians shown in the third column.

Frequently asked questions

Why is the tangent of 90 degrees undefined?

Tangent equals sine divided by cosine, and the cosine of 90 deg is exactly zero. Dividing by zero is undefined, so tan 90 deg has no finite value. As the angle approaches 90 deg the tangent grows without bound, toward positive infinity from below and negative infinity from above, which is why the graph has a vertical asymptote there. The same happens at 270 deg and every 180 deg beyond.

Should I enter my angle in degrees or radians?

Use whichever unit your problem is stated in and set the selector to match. Geometry and everyday problems are usually in degrees. Calculus, physics, and engineering often use radians. Surveying uses gradians or milliradians. If you have degrees but need radians, multiply by pi divided by 180. To go the other way, multiply radians by 180 divided by pi. Leaving the selector on the wrong unit is the most common mistake.

How do I find the angle if I already know the tangent?

Switch the calculator to "tan(theta) to angle" mode, enter the tangent value, and choose the output unit. The calculator applies arctan to return the principal angle between -90 deg and 90 deg. Because tangent repeats every 180 deg, add or subtract multiples of 180 deg (or pi, or 200 grad) to find every angle that shares the same tangent.

What is a gradians and when is it used?

A gradian (also called gon or grade) divides a full turn into 400 equal parts, so a right angle is exactly 100 grad and a straight line is exactly 200 grad. Gradians are used primarily in surveying and civil engineering because whole-number gradian angles correspond to convenient metric fractions of a right angle. Most modern calculators and programming languages support gradians alongside degrees and radians.

What are the six trigonometric functions and how are they related?

The six standard trig functions for an angle theta are: sin (opposite over hypotenuse on a unit circle, the y-coordinate), cos (adjacent over hypotenuse, the x-coordinate), tan (sin divided by cos, opposite over adjacent), cot (1/tan, cos divided by sin), sec (1/cos), and csc (1/sin). They satisfy: sin^2 + cos^2 = 1, 1 + tan^2 = sec^2, and 1 + cot^2 = csc^2. Toggle "Show all 6 trig values" to compute all of them at once.

How accurate is the tangent calculation?

The calculator uses the IEEE 754 double-precision floating-point arithmetic built into JavaScript, which is accurate to about 15 to 17 significant decimal digits. Results are displayed to 6 significant figures, which is more than sufficient for most engineering, physics, and academic uses. Near the asymptote at 90 deg (and its multiples) the calculator detects the near-zero cosine and reports Undefined rather than showing a very large inaccurate number.

Sources

Written by Dr. Elena Vasquez, PhD Mathematician · Lisbon, Portugal

Translating rigorous geometric theory into accurate, reliable calculation tools trusted by engineers, students, and researchers worldwide.

Search 3,500+ calculators

Loading search…