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
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.
- 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.
- "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.
- "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.
- "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 − α.
- "Hypotenuse and an acute angle" is the ladder and ramp case: a total length and the angle it makes with the ground.
- "Area and one leg" runs the arithmetic backwards, dividing twice the area by the leg you know to recover the other leg.
- 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.
- 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.
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.
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.
Frequently asked questions.
How many measurements do I need to solve a right triangle?
What is the difference between this and the Pythagorean theorem calculator?
Which angle is α, and does it matter which leg I call a?
Why does the calculator reject a hypotenuse equal to one of the legs?
What is the altitude to the hypotenuse and why would I want it?
Why is the circumradius always exactly half the hypotenuse?
Can I use this for a 30-60-90 or a 45-45-90 triangle?
Does this work if my triangle has no right angle?
How accurate are the results, and why do some come out exact?
What units should I use?
References& sources.
- [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]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]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]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]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]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