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
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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
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.
Frequently asked questions.
How many measurements do I need to solve a right triangle?
Which angle is α, and does it matter which leg I call a?
Why is a hypotenuse equal to or shorter than the leg rejected?
How do I work out a rafter length from the rise and the roof pitch?
How long does an accessible ramp need to be?
How can I check that a corner is truly square?
What is the altitude to the hypotenuse good for?
Why is the circumradius always half the hypotenuse?
Why does a small error in a shallow angle change the answer so much?
Does it handle 30-60-90 and 45-45-90 triangles?
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.
How this page was produced
- Published by
- Quanta Calculator
- Overseen by
- Daniel, Quanta Calculator Researcher
- 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