Audited 29 Jul 2026·Last updated 28 Oct 2026·6 citations·Tier 1·0 uses

Right Triangle Calculator

Solve a right triangle from two legs, a leg and hypotenuse, a side and an angle, or area and a leg: all sides, both angles, area, altitude and both radii.

Right Triangle Calculator

Which two measurements do you know?
One of the two sides that meet at the right angle. Angle α sits opposite this leg. Used by every mode except "hypotenuse and an acute angle".
The other side at the right angle. Angle β sits opposite it. Used only in "both legs" mode.
The side opposite the right angle, and always the longest one. In "leg and hypotenuse" mode it must be strictly greater than leg a.
In degrees, strictly between 0 and 90. This is the acute angle facing leg a — the angle between leg b and the hypotenuse. The other acute angle is 90 − α.
°
Used only in "area and one leg" mode, in the square of your length unit. The second leg comes back as 2 × area ÷ leg a.
Hypotenuse (c)
5
The side opposite the right angle and the longest of the three, in your length unit.
Leg a
3
Leg b
4
Angle α
36.8699°
Angle β
53.1301°
Area
6
Perimeter
12
Altitude to the hypotenuse
2.4
Inradius (r)
1
Circumradius (R)
2.5

Background.

Most right-triangle problems arrive as two numbers and a question about a third. How long does a rafter need to be for a 2-metre rise at a 30° pitch? How far from the wall should the foot of a 6-metre ladder stand? How much floor does a ramp need to climb 30 inches? Because one angle is fixed at 90°, any two independent measurements settle the whole triangle, provided at least one of them is a length. Choose the pair you have — both legs, a leg and the hypotenuse, a leg and the angle facing it, the hypotenuse and an acute angle, or the area and one leg — and the remaining sides, both acute angles, the area, the perimeter, the altitude onto the hypotenuse and the radii of the inscribed and circumscribed circles all follow.

Three facts do the solving. Euclid's Elements, Book I, Proposition 47, the Pythagorean theorem, ties the sides together: c² = a² + b². The trigonometric ratios tie sides to angles: sine is opposite over hypotenuse, cosine is adjacent over hypotenuse, tangent is opposite over adjacent. And since a triangle's angles total 180°, the two acute angles always add to 90°, so one gives you the other.

The labels are worth a moment before you type. Legs a and b meet at the right angle; the hypotenuse c lies opposite it and is always the longest side. Angle α faces leg a, which makes it the angle where leg b meets the hypotenuse. Swap that pairing and the two legs come back exchanged — a mirror image of the triangle you meant. Lengths can be in any unit as long as every one uses the same unit, since nothing is converted, and angles are always in degrees.

What is right triangle calculator?

A right triangle is a triangle with one 90° angle. The two sides forming it are the legs; the side opposite is the hypotenuse, which faces the largest angle and is therefore the longest side. Solving it means finding all three sides and both acute angles from a partial set. Several further quantities come with the solution. The area is ½ab, because perpendicular legs already serve as base and height. The altitude to the hypotenuse, h = ab ÷ c, is the shortest distance from the right-angle corner to the long side; Euclid's Book VI, Proposition 8 shows that it splits the triangle into two smaller triangles, each similar to the whole. The inradius, r = ½(a + b − c), is the radius of the largest circle that fits inside, and the circumradius, R = ½c, is the radius of the circle through all three corners. One curiosity follows from the inradius formula: for any triangle with whole-number sides, such as 3-4-5 or 5-12-13, a + b − c is even, so the inscribed circle has a whole-number radius too — 1 and 2 for those two triangles.

How to use this calculator.

  1. Pick the pair of measurements you actually have from the first menu. Two are always enough, provided one of them is a length; two angles alone fix the shape but not the size.
  2. For both legs, or a leg and the hypotenuse, enter the lengths. The hypotenuse must be strictly longer than the leg — a hypotenuse equal to or shorter than leg a is rejected, since no right triangle has one.
  3. For a leg and an angle, enter the angle that faces that leg. If you measured the angle at the other end of the leg, enter 90 minus your reading.
  4. For the hypotenuse and an angle — the ladder or ramp case — enter the full length and the angle it makes with the ground as α; leg a then comes back as the height and leg b as the horizontal distance.
  5. For area and one leg, enter the area in square units of the same length unit; the other leg is twice the area divided by the leg you know.
  6. Keep every length in one unit. Areas come back in that unit squared, angles are entered and returned in degrees, and each angle must lie strictly between 0° and 90°.

The formula.

c = √(a² + b²) , sin α = a⁄c , cos α = b⁄c , tan α = a⁄b , β = 90° − α

Each mode first finds the two legs and the hypotenuse. With both legs, c = √(a² + b²) and α = arctan(a ÷ b). With a leg and the hypotenuse, b = √(c² − a²) and α = arcsin(a ÷ c). With a leg and its opposite angle, c = a ÷ sin α and b = a ÷ tan α. With the hypotenuse and an angle, a = c × sin α and b = c × cos α. With area and a leg, b = 2A ÷ a, after which the triangle is solved as in the two-legs case. In every mode β = 90° − α.

The remaining outputs come from the three sides. Area is ½ab and perimeter a + b + c. The altitude comes from writing the area two ways: ½ab using the legs as base and height, and ½ch using the hypotenuse as base. Setting them equal gives h = ab ÷ c. The inradius has an equally short derivation. The inscribed circle touches each leg at a distance r from the right-angle corner, so the tangent lengths from the other two corners are a − r and b − r, and together they make up the hypotenuse: (a − r) + (b − r) = c, which gives r = ½(a + b − c). The circumradius is ½c because the hypotenuse is a diameter of the circumscribed circle — Thales' theorem read in reverse.

The angle modes inherit any error in the angle you measured, and shallow angles magnify it. With a leg of 10 opposite an angle of 5°, the hypotenuse is 114.7371; read the angle as 6° and it drops to 95.6677, about 17 percent shorter. The same one-degree slip near 60° moves the hypotenuse by about 1 percent. When an angle is small and you can measure a second length instead, a two-length mode will usually give the better answer.

A worked example.

Example

A 6-metre ladder leans against a wall, making a 75° angle with level ground. Choose hypotenuse and an acute angle, and enter 6 for the hypotenuse and 75 for α, so leg a is the height on the wall and leg b the distance out from it. The height reached is a = 6 × sin 75° = 6 × 0.96593 = 5.7956 m. The foot stands b = 6 × cos 75° = 6 × 0.25882 = 1.5529 m from the wall. The angle between the ladder and the wall is β = 90° − 75° = 15°. The area enclosed is ½ × 5.7956 × 1.5529 = 4.5 m², and it comes out exact: ½ab = ½c² sin α cos α = ¼c² sin 2α = ¼ × 36 × sin 150° = 9 × 0.5 = 4.5. The perimeter is 6 + 5.7956 + 1.5529 = 13.3485 m. The altitude from the corner where wall meets floor to the ladder is ab ÷ c = 9 ÷ 6 = 1.5 m. The inradius is ½(5.7956 + 1.5529 − 6) = 0.6742 m, and the circumradius is 6 ÷ 2 = 3 m — the midpoint of the ladder is the same 3 m from the top, the foot and the corner. The foot distance is what a safety rule cares about. OSHA's rule for ladders that lean on a support puts the foot about one quarter of the working length out, which for 6 m is 1.5 m and corresponds to an angle of about 75.5°. This setup puts the foot 1.5529 m out, roughly 5 cm further than the quarter rule, so it is very slightly shallower than the rule intends.

hypotenuse6
knownhypotenuseAngle
angle Alpha75

Frequently asked questions.

How many measurements do I need to solve a right triangle?
Two, as long as at least one is a length. The right angle is given, and the two acute angles must add to 90°, so one angle fixes the shape. A single length then fixes the size. Two angles on their own are never enough: every enlargement or reduction of the triangle has the same angles, so the size stays undetermined.
Which angle is α, and does it matter which leg I call a?
α is the acute angle facing leg a — the one where leg b meets the hypotenuse. Either leg can be called a, provided the angle you enter faces it. If you measured the angle at the other end, enter 90 minus that value. When the pairing is reversed the results are still a valid triangle, but with the two legs exchanged, which is easy to miss.
Why is a hypotenuse equal to or shorter than the leg rejected?
The hypotenuse faces the 90° angle, the largest in the triangle, so it must be strictly the longest side. If c equals a, the other leg would be √(c² − a²) = 0, a flat line with no area. If c is shorter than a, the formula needs the square root of a negative number and no real triangle exists at all.
How do I work out a rafter length from the rise and the roof pitch?
Use a leg and its opposite angle, with the rise as leg a and the pitch as α, since the pitch angle at the eave faces the rise. A 2 m rise at 30° gives a rafter of 4 m along its slope and a run of 3.4641 m. If the pitch is given as a ratio such as 6 in 12, use the two-legs mode with 6 and 12: the angle is 26.5651° and the slope length is 13.4164 per 12 of run. Overhang and ridge thickness are separate allowances.
How long does an accessible ramp need to be?
Under the 2010 ADA Standards a ramp's running slope may be no steeper than 1:12, and a single run may rise no more than 30 inches. Enter a rise of 30 and a horizontal run of 360 inches in the two-legs mode: the ramp surface is 361.2478 inches long and climbs at 4.7636°. The horizontal run, not the sloped length, is the figure the slope limit uses.
How can I check that a corner is truly square?
Measure 3 units along one edge and 4 along the other; for a right angle the diagonal between the marks is exactly 5. Builders scale the same triangle up to 6-8-10 for bigger layouts. The legs mode gives the diagonal for any pair of offsets. Run in reverse, the theorem also diagnoses the error: if a² + b² is larger than the measured diagonal squared, the corner is acute; if smaller, it is obtuse.
What is the altitude to the hypotenuse good for?
It is the shortest distance from the right-angle corner to the long side: the clearance under a diagonal brace or the depth beneath a stair stringer. It also splits the hypotenuse into two segments, a² ÷ c and b² ÷ c, and is their geometric mean. For a 3-4-5 triangle the segments are 1.8 and 3.2, and √(1.8 × 3.2) = 2.4, which matches ab ÷ c = 12 ÷ 5.
Why is the circumradius always half the hypotenuse?
Because the hypotenuse is a diameter of the circle through all three corners. Thales' theorem says any angle inscribed in a semicircle is a right angle; read backwards, a right angle's opposite side must be a diameter. The circle's centre is therefore the midpoint of the hypotenuse. This is why a carpenter's square can locate the centre of a disc: the square's arms always cut the rim at the two ends of a diameter.
Why does a small error in a shallow angle change the answer so much?
Because the sine and tangent of a small angle change quickly relative to their size. With leg 10 opposite 5°, the hypotenuse is 114.7371; at 6° it is 95.6677, about 17 percent less, from a one-degree difference. The same slip near 60° shifts the hypotenuse by about 1 percent. For long, shallow triangles such as gentle slopes, measuring two lengths gives a steadier result than measuring an angle.
Does it handle 30-60-90 and 45-45-90 triangles?
Yes, with no special setting. A hypotenuse of 10 at α = 30° gives legs of 5 and 8.6603, the 1 : √3 : 2 proportions. At α = 45° both legs are 7.0711, the 1 : 1 : √2 case, and the altitude to the hypotenuse is exactly 5, half the hypotenuse, because in the isosceles case it runs to the midpoint.

References& sources.

  1. [1]Wolfram Research, MathWorld — ‘Right Triangle’ (live revision retrieved 2026-07-29). Equation (3) area A = ½ab; Equation (5) inradius r = ab/(a+b+c); Equation (7) r = ½(a+b−c); Equation (8) circumradius R = ½c; and the statement that the altitude from the right angle produces two triangles similar to each other and to the whole. Open access.
  2. [2]Euclid, Elements, Book I, Proposition 47 — ‘In right-angled triangles the square on the side opposite the right angle equals the sum of the squares on the sides containing the right angle.’ David E. Joyce web edition of the Heath translation, Clark University; retrieved 2026-07-29.
  3. [3]Euclid, Elements, Book VI, Proposition 8 and its corollary — ‘If in a right-angled triangle a perpendicular is drawn from the right angle to the base, then the triangles adjoining the perpendicular are similar both to the whole and to one another’, and ‘the straight line so drawn is a mean proportional between the segments of the base.’ Both quotations confirmed on retrieval 2026-07-29 from the Joyce edition. This is the source of the altitude formula h = ab/c.
  4. [4]OpenStax (Rice University), Algebra and Trigonometry 2e, §7.2 ‘Right Triangle Trigonometry’ (current web revision, retrieved 2026-07-29) — the SOH-CAH-TOA definitions sine = opposite/hypotenuse, cosine = adjacent/hypotenuse, tangent = opposite/adjacent, and the statement that the two remaining angles of a right triangle add up to π/2, giving the cofunction identities. Open access.
  5. [5]NIST (US Department of Commerce), Digital Library of Mathematical Functions, §4.14 ‘Definitions and Periodicity’ — the reference definitions and identities of the trigonometric functions used to convert between the side ratios and the acute angles on this page. Open access.
  6. [6]Coxeter, H. S. M. Introduction to Geometry, 2nd edition. Wiley, 1969 — standard reference geometry text covering the incircle, circumcircle and similarity results used here. Print reference; bibliographic record only, listed for completeness rather than as the source of any computed value.

How this page was produced

Published by
Quanta Calculator
Primary sources
6 cited below
Method
c = √(a² + b²) , sin α = a⁄c , cos α = b⁄c , tan α = a⁄b , β = 90° − α
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon