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

Right Triangle Calculator

Solve a right triangle from any two knowns: two legs, a leg and the hypotenuse, or a side and an angle. Get both acute angles, area, altitude and 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, always the longest of the three. Echoed back unchanged in the two modes where you supply it.
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.

The Quanta right triangle calculator solves the entire triangle from any two measurements you happen to have. Choose the pair you know — the two legs, a leg and the hypotenuse, a leg and its opposite angle, the hypotenuse and an acute angle, or the area and a leg — and the calculator returns all three sides, both acute angles, the area, the perimeter, the altitude from the right angle onto the hypotenuse, the inradius and the circumradius. Two measurements are always enough, because the third angle is already known: it is the 90° that makes the triangle right in the first place. General triangles need three.

That is the practical difference between this page and the two neighbouring ones. If all you want is the theorem — two sides in, the missing side out — the Pythagorean theorem calculator is the simpler tool, and it is linked below. If your triangle has no right angle at all, the triangle solver handles the general SSS, SAS and ASA cases. This page sits between them: it assumes the right angle so you only have to supply two facts, and in exchange it will accept an angle or an area as one of them, which the theorem alone cannot do.

The naming used throughout is the standard one. The two sides meeting at the right angle are the legs, written a and b. The side opposite the right angle is the hypotenuse, c, and it is always the longest side. The acute angle facing leg a is α, the one facing leg b is β, and because the angles of a triangle sum to 180°, α + β = 90° exactly. That complementary relationship is why entering a single acute angle is enough to pin down the shape, and why the sine of one acute angle always equals the cosine of the other.

Five relationships do all the work. Euclid's Elements, Book I, Proposition 47 gives c² = a² + b², which covers the two side-only modes. The three ratios from right-triangle trigonometry — sin α = a/c, cos α = b/c, tan α = a/b, the SOH-CAH-TOA of every trigonometry course — cover the two angle modes in both directions. The area is ½ab, because perpendicular legs serve directly as base and height, which makes the area-and-leg mode a single division. Everything else is derived once all three sides are known.

Three of the outputs are worth knowing about even if you did not come looking for them. The altitude onto the hypotenuse, h = ab ÷ c, is the shortest distance from the right-angle corner to the long side; Euclid VI.8 proves that dropping it creates two smaller triangles each similar to the original, which is the cleanest proof of the Pythagorean theorem there is. The circumradius is simply half the hypotenuse, because the hypotenuse is a diameter of the circle through all three corners — Thales's theorem in reverse, and the reason a carpenter can find the centre of a circle with a set square. The inradius, r = ½(a + b − c), is the radius of the largest circle that fits inside, and it turns up whenever something round has to be seated in a corner.

Right triangles are the workhorse of applied measurement precisely because the two legs are independent. A roof's rise and run give the rafter length and the pitch angle. A ramp's length and slope give the rise, which is what accessibility codes actually regulate. A ladder's length and the angle it leans at give both the height it reaches and the distance its foot stands from the wall — the worked example below runs exactly that calculation for a 6 metre ladder at 75°. Surveying, navigation, machining, screen dimensions, stair layout, truss design and every distance formula in coordinate geometry reduce to the same two legs and one hypotenuse.

One scope note belongs beside the answer rather than below it: this page assumes one angle is exactly 90°. If yours is not, the numbers here will be confidently wrong, and the law of cosines or the triangle solver is the page you want. Angles are entered and returned in degrees, never radians, and all three sides must share the same unit — the calculator has no unit field and does no conversion.

What is right triangle calculator?

A right triangle is a triangle containing one 90° angle. The two sides that form that angle are the legs; the side opposite it is the hypotenuse, which is necessarily the longest of the three because it faces the largest angle. Solving a right triangle means finding all six of its measurements — three sides and three angles — from a partial set, and because one angle is fixed at 90° and the other two must sum to 90°, only two independent measurements are ever needed. Wolfram MathWorld's Right Triangle entry collects the standard derived quantities: the area A = ½ab (its Equation 3), the inradius r = ab/(a + b + c) (Equation 5), equivalently r = ½(a + b − c) (Equation 7), and the circumradius R = ½c (Equation 8), which restates the fact that the hypotenuse is a diameter of the circumcircle. The side relationship is Euclid's, from Elements Book I, Proposition 47: the square on the hypotenuse equals the sum of the squares on the legs. The angle relationships are the definitions of the trigonometric ratios as OpenStax states them in Algebra and Trigonometry 2e §7.2 — sine is opposite over hypotenuse, cosine adjacent over hypotenuse, tangent opposite over adjacent — together with the observation in the same section that the two acute angles are complementary, so the sine of one is the cosine of the other. Dropping a perpendicular from the right angle to the hypotenuse produces the configuration of Euclid Book VI, Proposition 8: the two triangles it creates are similar to each other and to the whole, and the corollary adds that the perpendicular is the mean proportional between the two segments it cuts the hypotenuse into. That single picture yields the altitude formula h = ab/c and a one-line proof of the Pythagorean theorem.

How to use this calculator.

  1. Pick the pair of measurements you actually have from the dropdown. Two are always enough — the 90° angle counts as the third fact for free.
  2. "Both legs" is the classic case: enter a and b and read the hypotenuse, plus both acute angles which the theorem alone would not give you.
  3. "One leg and the hypotenuse" solves for the missing leg. The hypotenuse must be strictly longer than the leg; if it is not, the calculator flags the field rather than returning an imaginary side.
  4. "One leg and its opposite angle" is the mode for field measurements — a rise and a pitch angle, a rafter and a roof slope. Angle α faces leg a, so if you measured the angle at the far end of the leg you want the other one, 90 − α.
  5. "Hypotenuse and an acute angle" is the ladder and ramp case: a total length and the angle it makes with the ground.
  6. "Area and one leg" runs the arithmetic backwards, dividing twice the area by the leg you know to recover the other leg.
  7. Enter all lengths in the same unit. The calculator does no conversion, so millimetres mixed with inches will produce a wrong triangle silently. The area comes back in that unit squared.
  8. Read the altitude, inradius and circumradius from the breakdown if you need them — they are computed in every mode, not just the side-only ones.

The formula.

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

Each mode reduces to finding the two legs and the hypotenuse; every other output is then built from those three. In "both legs" mode, c = √(a² + b²) by Euclid I.47 and α = arctan(a ÷ b). In "leg and hypotenuse" mode the same theorem is rearranged, b = √(c² − a²), and α = arcsin(a ÷ c). In "leg and angle" mode the ratios run the other way: c = a ÷ sin α and b = a ÷ tan α. In "hypotenuse and angle" mode, a = c × sin α and b = c × cos α. In "area and leg" mode, b = 2A ÷ a, after which the triangle is solved exactly as in the two-legs case. In all five, β = 90 − α.

The derived quantities are the same in every mode. The area is ½ab, because two perpendicular legs are a base and a height already. The perimeter is a + b + c. The altitude onto the hypotenuse comes from computing the area twice: ½ab measures it using the legs, ½ch measures it using the hypotenuse as base, and setting them equal gives h = ab ÷ c. The inradius is ½(a + b − c), MathWorld's Equation 7, and the circumradius is half the hypotenuse, its Equation 8.

Working the page's example all the way through — a 6 metre ladder leaning at 75° to the ground, entered as hypotenuse 6 with angle α = 75. Leg a, the height reached up the wall, is 6 × sin 75° = 6 × 0.9659258263 = 5.7955549577 metres. Leg b, the distance from the wall to the foot of the ladder, is 6 × cos 75° = 6 × 0.2588190451 = 1.5529142706 metres. The other acute angle is 90 − 75 = 15°, which is the angle between the ladder and the wall. The area is ½ × 5.7955549577 × 1.5529142706 = 4.5 square metres exactly, and it comes out exact because ½c² sin α cos α = ¼c² sin 2α = ¼ × 36 × sin 150° = 9 × 0.5 ÷ 2. The perimeter is 6 + 5.7955549577 + 1.5529142706 = 13.3484692283 metres. The altitude onto the hypotenuse is ab ÷ c = 9 ÷ 6 = 1.5 metres exactly, since ab is twice the area. The inradius is ½(5.7955549577 + 1.5529142706 − 6) = 0.6742346142, and MathWorld's other formula ab ÷ (a + b + c) = 9 ÷ 13.3484692283 gives 0.6742346142 as well. The circumradius is 6 ÷ 2 = 3.

Why the altitude matters: Euclid VI.8 states that a perpendicular drawn from the right angle to the hypotenuse leaves two triangles similar to each other and to the whole, and its corollary states that the perpendicular is the mean proportional between the two pieces it cuts the hypotenuse into. For the 3-4-5 triangle those pieces are 9/5 = 1.8 and 16/5 = 3.2, and √(1.8 × 3.2) = √5.76 = 2.4, which is exactly ab ÷ c = 12 ÷ 5. The calculator's tests assert that identity on every sample triangle.

Rounding stage: all arithmetic runs in Decimal at 40 significant digits and is rounded once, at the return boundary, to 10 decimal places. Decimal.js has no trigonometric functions, so sine, cosine, tangent, arcsine and arctangent are evaluated once each in double precision and the result is immediately lifted back into Decimal — an error floor near 1e-16, three orders of magnitude below the last digit displayed. No side is rounded before the area, altitude or radii are derived from it, which is why the worked example returns 4.5 and 1.5 exactly rather than 4.4999999999 and 1.4999999999. Nothing on this page is sorted into bands or grades, so no threshold depends on display rounding.

A worked example.

Example

A 6 metre ladder is set against a wall at 75° to level ground, and the question is how high it reaches and how far out its foot stands. Choosing "hypotenuse and an acute angle" and entering 6 and 75 gives leg a = 5.7955549577 metres — the height up the wall — and leg b = 1.5529142706 metres, the standoff distance at the base. The other acute angle comes back as exactly 15°, the angle between the ladder and the wall. The triangle enclosed measures 4.5 square metres, its perimeter is 13.3484692283 metres, and the altitude from the right-angle corner onto the ladder itself is exactly 1.5 metres: that is the shortest distance from the point where the wall meets the floor to the line of the ladder, which is the clearance a bucket or a toolbox has to fit inside. The inradius is 0.6742346142 metres, so the largest circle that fits into the wedge under the ladder is about 1.35 metres across. The circumradius is 3 metres, exactly half the ladder, because the midpoint of the ladder is equidistant from all three corners — the same fact that makes a hypotenuse a diameter. Two of these numbers are exact rather than rounded, which is a useful check on the arithmetic: the area is 4.5 because ½c² sin α cos α collapses to ¼ × 36 × sin 150°, and the altitude is 1.5 because ab equals twice the area, 9, so ab ÷ c is 9 ÷ 6. For the record, 75° is just shy of the 4-to-1 rule of thumb for extension ladders, which corresponds to about 76°, so this ladder is set almost exactly as 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 of them is a side. The 90° angle is given by the shape, and the two acute angles must sum to 90°, so knowing one acute angle gives you the other for free. That leaves one unknown scale factor, which any single length pins down. Two angles alone are not enough — they fix the shape but not the size, and every similar triangle of any size would satisfy them. This is why a general triangle needs three measurements and a right triangle needs only two.
What is the difference between this and the Pythagorean theorem calculator?
The Pythagorean theorem calculator takes two sides and returns the third, plus area and perimeter. It has no angle field and no angle output, so it cannot start from an angle or tell you one. This page covers those two side-only cases as well, but it also solves from a leg and an angle, from the hypotenuse and an angle, and from the area and a leg, and it returns both acute angles, the altitude onto the hypotenuse, the inradius and the circumradius. If your problem is purely about lengths, the theorem page is quicker; if an angle is involved anywhere, use this one.
Which angle is α, and does it matter which leg I call a?
α is the acute angle opposite leg a — the angle where leg b meets the hypotenuse. It does not matter which of the two legs you call a, as long as the angle you enter is the one facing it. If you have measured the other acute angle instead, enter 90 minus your measurement. Getting this backwards is the single most common mistake in leg-and-angle problems, and the symptom is obvious: the two legs come out swapped, so the triangle is the mirror image of the one you meant.
Why does the calculator reject a hypotenuse equal to one of the legs?
Because the hypotenuse faces the 90° angle, which is the largest angle in the triangle, so it must be strictly the longest side. If c equals a, the second leg would be √(c² − a²) = 0, which is a line segment rather than a triangle. If c is shorter than a, the formula asks for the square root of a negative number and no real triangle exists. The calculator flags the hypotenuse field instead of returning zero or a complex number, because a silent zero would propagate into the area, the altitude and the radii and produce a page of plausible-looking nonsense.
What is the altitude to the hypotenuse and why would I want it?
It is the perpendicular dropped from the right-angle corner onto the hypotenuse, h = ab ÷ c, and it is the shortest distance from that corner to the long side. Practically, it is the clearance under a diagonal brace, the depth available beneath a stair stringer, or the thickness of material a diagonal cut leaves behind. Mathematically it is more interesting: Euclid VI.8 shows that drawing it splits the triangle into two smaller triangles that are each similar to the original, and the corollary shows that h is the mean proportional between the two segments it cuts the hypotenuse into. For a 3-4-5 triangle those segments are 1.8 and 3.2, and √(1.8 × 3.2) = 2.4 = 12 ÷ 5.
Why is the circumradius always exactly half the hypotenuse?
Because the hypotenuse is a diameter of the circle that passes through all three vertices. Thales's theorem says that any angle inscribed in a semicircle is a right angle; read in reverse, if a triangle has a right angle then the side opposite it must be a diameter. The centre of that circle is therefore the midpoint of the hypotenuse, and the radius is half its length. This is the reason a set square can locate the centre of a circle: slide the right angle around the rim and the two edges will always cut the circle at the ends of a diameter.
Can I use this for a 30-60-90 or a 45-45-90 triangle?
Yes. Choose "hypotenuse and an acute angle" and enter 30, 60 or 45 — the special ratios drop out automatically. With a hypotenuse of 10 and α = 30 you get legs of 5 and 8.6602540378, the familiar 1 : √3 : 2 proportions. With α = 45 you get two legs of 7.0710678119, the 1 : 1 : √2 case. The dedicated 30-60-90 and 45-45-90 pages are worth reading for the exact radical forms and the memorisation shortcuts, but the arithmetic here is the same and works for any angle, not just the two special ones.
Does this work if my triangle has no right angle?
No, and the results would be wrong rather than merely imprecise. Every formula on this page assumes one angle is exactly 90°. For an oblique triangle use the triangle solver, which takes three sides, two sides and the included angle, or two angles and the included side; or the law of cosines and law of sines pages if you want to see the individual steps. A useful test: if you know all three sides, check whether a² + b² equals c² for the longest side c. If the left side is larger the triangle is acute, if smaller it is obtuse, and only equality means it is right.
How accurate are the results, and why do some come out exact?
All arithmetic is carried at 40 significant digits and rounded once at the end to 10 decimal places, so the displayed figures are correct to every digit shown. The one approximation is the trigonometry itself: sine, cosine, tangent and their inverses are evaluated in standard double precision, an error near 1e-16, which is far below the last digit displayed. Some outputs are exact anyway because the algebra collapses — the 6 metre ladder at 75° gives an area of exactly 4.5 because ½c² sin α cos α reduces to ¼c² sin 2α with sin 150° = 0.5, and an altitude of exactly 1.5 because ab is twice the area. Those exact values are asserted in the test suite, so a change that broke them would fail the build.
What units should I use?
Any single unit, consistently. The calculator has no unit selector and performs no conversion, so all lengths must be in the same one — all metres, all inches, all pixels. The area is returned in that unit squared, and the inradius, circumradius and altitude in the unit itself. Angles are always in degrees, both entered and returned, and are restricted to the open interval between 0° and 90°: at either end the triangle collapses to a line segment with no area.

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.

In this category

Embed

Quanta Pro

Paid features are coming later.

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