Skip to content
Calculator Collection

Tangent Calculator

Calculates the tangent of an angle entered in degrees, representing the ratio of opposite to adjacent in a right triangle (or rise/run for a slope). Use it when finding the slope of a line, sizing roof pitch, or measuring height from a known horizontal distance.

Last updated: May 2026

Fill in the required fields to see your result.

Compare with similar

About this calculator

The tangent function is defined as the ratio of the opposite side to the adjacent side in a right triangle: tan(θ) = opposite / adjacent. Equivalently, it is the ratio of sine to cosine: tan(θ) = sin(θ) / cos(θ). For degree-based input, the formula applied is tan(angle × π / 180). Variables: angle (in degrees, any real number except odd multiples of 90° where tangent is undefined). Unlike sine and cosine, tangent is not bounded — its values range from −∞ to +∞. It equals 0 at 0°, 1 at 45°, and approaches infinity as the angle nears 90° (where cosine approaches zero in the denominator). Tangent is periodic with period 180° (not 360° like sine and cosine), meaning tan(θ + 180°) = tan(θ). It is also odd: tan(−θ) = −tan(θ). Key reference values: tan(0°) = 0, tan(30°) = 1/√3 ≈ 0.5774, tan(45°) = 1, tan(60°) = √3 ≈ 1.7321, tan(90°) = undefined (vertical asymptote), tan(135°) = −1. Edge cases: at exactly 90°, 270°, and every odd multiple of 90°, tangent is mathematically undefined; computer implementations may return very large positive or negative floating-point numbers (or NaN) near those values — handle carefully. Tangent is the natural function for computing slopes and grades: a slope of 'rise over run' equals the tangent of the angle of inclination. It is used in surveying for measuring heights from horizontal distances, in engineering for road and railway grades, and in optics for refraction calculations.

How to use

Example 1: Find tan(30°). Step 1: convert to radians — 30 × π/180 ≈ 0.5236 radians. Step 2: compute tan(0.5236) ≈ 0.5774. Verify: this is 1/√3, the exact value for tan(30°). Practical meaning: a 30° ramp rises 0.5774 m for every 1 m of horizontal distance — about a 58% grade. Example 2: Estimate tree height. You stand 50 m from a tree's base and measure the angle of elevation to the top as 35°. Step 1: tan(35°) ≈ 0.7002. Step 2: height = distance × tan(angle) = 50 × 0.7002 ≈ 35.0 m. Verify: this matches the tangent definition — opposite (tree height) / adjacent (your distance) = 35/50 = 0.7, consistent with tan(35°). Add your eye height (~1.7 m) for total tree height if measuring from eye level.

Frequently asked questions

What does the tangent of an angle mean in practical terms?

Tangent represents the slope — the ratio of vertical rise to horizontal run — at a given angle. A tangent of 1 means a 45° incline where rise equals run. A tangent of 0.5 means the surface rises 0.5 units for every 1 unit traveled horizontally, equivalent to a ~26.6° angle. This makes tangent the go-to function in construction, road design, and surveying when you need to relate an angle to a physical slope or gradient. Road grades are often expressed as a percentage equal to 100 × tan(angle): a 5% grade means tan(angle) = 0.05, or an angle of about 2.86°. Roofing pitch ratios (e.g., '6:12') are also tangent values — 6:12 means tan(angle) = 6/12 = 0.5, or ~26.6°.

Why is the tangent undefined at 90 degrees?

At 90°, the adjacent side of the right triangle shrinks to zero, and dividing by zero is mathematically undefined. As the angle approaches 90° from below, the tangent grows without bound toward positive infinity; from above, it approaches negative infinity. On the unit circle this corresponds to the cosine (x-coordinate, denominator of tan = sin/cos) approaching zero. Tangent therefore has vertical asymptotes at 90°, 270°, and every odd multiple of 90°. Computer implementations may return very large but finite numbers near these values due to floating-point precision; for theoretical calculations, treat the function as undefined at those angles. The same undefined behavior occurs in the Mercator projection (used in maps) at the poles, which is why Mercator maps cannot show the geographic poles.

How do I use the tangent function to find the height of a tall object?

If you know the horizontal distance to an object and the angle of elevation to its top, the height is height = distance × tan(angle). For example, stand 50 m from a tree, measure an elevation angle of 35°, and the tree height is 50 × tan(35°) ≈ 50 × 0.7002 ≈ 35 m. This technique is foundational in surveying, forestry, navigation, and astronomy. Make sure the angle is measured from the horizontal, not the vertical; many laser rangefinders and clinometers can report either. Add the observer's eye height to get the total height when measuring from eye level rather than ground level. The same method works for measuring the depth of a canyon, the height of a building, or the altitude of a balloon.

What are common mistakes when computing tangent values?

Forgetting degree mode and computing tan(45) as 45 radians instead of 45 degrees gives 1.62 instead of 1 — wildly wrong. Trying to evaluate tan(90°) or other odd multiples of 90° returns undefined values or numerical overflow — always check the angle isn't at an asymptote. Confusing tangent with arctangent (the inverse function) gives the wrong direction of conversion. Misreading a roof pitch ratio: '6:12' means rise:run = 6:12, so tan(angle) = 0.5 and angle ≈ 26.6° — not 6° or 12°. For very steep angles (above 80°), small angle errors produce huge tangent value changes — use sine or cosine if your accuracy demands are tight. Floating-point precision near asymptotes makes tangent particularly sensitive; for angles within 1° of 90° or 270°, use alternative formulas based on cotangent or direct sin/cos ratios.

When should I NOT use a basic tangent calculator?

Near 90° (or any odd multiple of 90°), tangent is undefined or numerically unstable — use cotangent (cot = cos/sin) instead, which is well-behaved at 90° and undefined at 0° and 180°. Hyperbolic tangent (tanh) is a different function used in neural network activation, special relativity, and probability theory — don't confuse it with the trigonometric tangent. For three-dimensional angles between vectors, use the dot-product-and-magnitudes formula and arccosine rather than trying to extract a tangent. Spherical trigonometry on Earth's surface uses different formulas. Solving for the angle given the slope ratio requires the inverse function (arctan), not regular tangent — arctan(rise/run) returns the angle. Very small angles (< 1°) make tangent nearly equal to the angle in radians (tan(θ) ≈ θ for small θ), so the small-angle approximation suffices for many engineering shortcuts.

Sources & references