Of all the shapes in geometry, the right triangle is the workhorse. One square corner, two legs, one slanted hypotenuse — and from that simple frame, a surprising amount of the built world hangs together: roofs, ramps, ladders, cables, stairs, sight lines, even the way GPS resolves distances. The calculator on this page solves the complete right triangle from just the two legs: it gives you the hypotenuse, both acute angles in degrees, the perimeter, and the area, in one pass. This article explains every output, why the formulas work, and how to read the numbers when you meet them in real life.
What a right triangle is
A right triangle has exactly one angle of exactly 90 degrees. The two sides that meet at that corner are called the legs; the side opposite the corner, always the longest, is the hypotenuse. No matter how long or short the legs are, the hypotenuse is the side that stretches diagonally between their ends. The sum of the other two angles is always 90 degrees, because every triangle's angles add up to 180 — which is why the calculator can give you the second angle simply by subtracting the first from 90.
The most famous right triangle in history is the 3–4–5: legs of 3 and 4 give a hypotenuse of exactly 5. It is the default starting point of this tool, and builders have used the same triple for thousands of years to square corners on job sites — a rope knotted at 3, 4, and 5 units will pull into a perfect 90-degree angle. You will recognize its outputs immediately in the results: hypotenuse 5, angles near 36.87 and 53.13 degrees, perimeter 12, area 6.
The Pythagorean theorem
The hypotenuse is the flagship output, and it comes from the single most famous equation in mathematics:
c² = a² + b², therefore c = sqrt(a² + b²)
Pythagoras of Samos gets the credit in western history, but the relation was known and used centuries earlier in Babylon, India, and China. Its meaning is geometric: the square built on the hypotenuse has exactly the area of the two squares built on the legs combined. For a 3–4–5 triangle, the squares are 9 and 16, which add to 25, and 25 is exactly 5 squared.
The calculator applies the theorem with the legs you choose and takes the square root, giving a hypotenuse that is exact for perfect triples and rounded to two decimals otherwise. For 2 and 3, for example, you get the square root of 13, about 3.61. Because every step of the formula is reversible, the same equation also works in reverse: if you know one leg and the hypotenuse, the missing leg is the square root of the difference of their squares. This tool, however, is built around the two-leg case, so the hypotenuse is always derived, never entered.
Finding the angles: arctangent in degrees
Geometry teachers draw angle arrows; the calculator computes them. Given the two legs, the angle opposite leg A can be recovered from the ratio of the legs using the arctangent function (also written atan, tan⁻¹, or inverse tangent):
∠A = atan(a / b) × 180 / π
The ratio a/b describes how steeply the hypotenuse rises relative to the base, and the arctangent of that ratio is the angle. The trigonometric functions work in radians by default in most computing environments, so the formula multiplies by 180 over pi to convert radians into the degrees people actually read off protractors. Once ∠A is known, ∠B is simply 90 degrees minus ∠A, because the two acute angles must share the remaining 90 degrees between them.
For the 3–4–5 example, atan(3/4) is about 0.6435 radians, which is 36.87 degrees; subtracting from 90 gives 53.13 degrees. Notice the pattern: the angle opposite the shorter leg is smaller. You can check any result by the sum rule — the two printed angles should always add to 90 degrees, up to rounding.
Why atan instead of the sine or cosine?
Any of the three inverse trig functions could in principle reach the angle, but arctangent is the most robust choice when you have both legs: it works directly from the ratio a/b, needs no separate hypotenuse in the middle, and returns the correct quadrant without special cases. The sine approach would require dividing a by c, which introduces the same numbers with an extra step and a slightly larger rounding footprint in the final digits.
Perimeter: walking the whole outline
The perimeter is the distance all the way around the triangle — the length of fence you would need to enclose it:
perimeter = a + b + c
Because c itself is computed by the Pythagorean theorem, the perimeter is really a + b + sqrt(a² + b²). For legs of 3 and 4 the perimeter is 3 + 4 + 5 = 12. For legs of 10 and 24 it is 10 + 24 + 26 = 60 — another classic triple. The perimeter inherits the units of the legs: if you measure the legs in meters, the perimeter is in meters too, and you can mentally frame fence, trim, frame, or border jobs around it directly.
Area: the half-times-the-base rule
The area of a triangle is always base times height over two, and the right triangle is the friendliest case because its legs are already perpendicular — each leg can serve as the base with the other as the height. So:
area = (a × b) / 2
For 3 and 4 the area is 6 square units, exactly half of the 3 by 4 rectangle that the two legs would frame. You can see the logic by drawing the rectangle: the triangle is precisely half of it, cut along a diagonal. This is the same reason tiling, flooring, and gable-roof area problems collapse so easily into right triangles — every sloped surface can be triangulated into right triangles whose leg products divide cleanly by two.
Reading the five outputs together
| Output | Formula | Example (3, 4) |
|---|---|---|
| Hypotenuse | sqrt(a² + b²) | 5 |
| Angle opposite A | atan(a/b) × 180/π | 36.87° |
| Angle opposite B | 90° − ∠A | 53.13° |
| Perimeter | a + b + c | 12 |
| Area | a × b / 2 | 6 |
The five numbers are not independent facts; they are five views of the same shape. Move either leg slider and all five update together, because the shape is fully determined by the two legs. That is the elegant part of right-triangle solving: two inputs pin down the entire geometry, and everything else follows by formula.
Where these numbers show up in the real world
Ladders and ramps
Rest a ladder against a wall. The ground-to-wall distance and the wall height are the legs; the ladder is the hypotenuse. The angle opposite the ground distance is the tilt of the ladder — the same number the angle output prints. Safety guides quote ladder angles (about 75 degrees from the ground for most ladders); with this tool you can translate a measured leg pair directly into that angle and check the setup.
Roofs and stairs
A roof truss is two right triangles sharing a vertical leg. The horizontal run and the rise are your legs; the rafter length is the hypotenuse, and the pitch angle appears as ∠A. Stairs work the same way: the riser height and tread depth are legs, and the angle they produce is the stair's pitch. Perimeter and area come along free — the area of a gable end is exactly the triangle area output, useful for painting and siding estimates.
Surveying and cables
Surveyors and electricians live on right triangles. A cable stretched between two poles at different heights forms a hypotenuse over a known horizontal distance and a measured height difference; the angle output is the cable's angle of elevation. The same math resolves sight lines, guy-wire lengths, and crane boom reaches. Distance is often reported in feet and angles in degrees — matching the calculator's natural language.
Trigonometry homework
For students, the tool doubles as a verification bench: compute by hand with the sine, cosine, and tangent ratios, then compare with the printed angles. Every textbook result (sin ∠A = a/c, cos ∠A = b/c, tan ∠A = a/b) should reproduce the outputs above to within rounding, which makes it an honest check of both the tool and your own working.
Perfect triples you will meet often
- 3–4–5 (the classic; hypotenuse 5, angles 36.87 and 53.13)
- 5–12–13 (hypotenuse 13, angles near 22.62 and 67.38)
- 8–15–17 (hypotenuse 17)
- 7–24–25 (hypotenuse 25)
- 9–40–41 (hypotenuse 41)
Multiples of any triple are also exact: 6–8–10, 30–40–50, 15–20–25. The calculator cannot distinguish a triple from any other leg pair, but recognizing them lets you spot exact answers before you read them — the hypotenuse will print with a clean zero after the decimal for these shapes.
Limits, rounding, and honest numbers
The legs here range from 1 to 1000, which covers home-scale problems in centimeters, inches, feet, or meters. The hypotenuse and angles print to two decimal places, which is tighter than any field measurement you will take with a tape measure. Rounding means the two printed angles may not sum to exactly 90.00 in edge cases — the unrounded values do; the display simply clips them. Likewise, the area prints in square units, so if your legs are feet, the area is square feet; if they are meters, square meters.
One caution: this calculator starts from the legs. If your real-world problem gives you a leg and the hypotenuse instead (say, a ladder length and the wall height), re-arrange the Pythagorean theorem to find the missing leg first, then come back — or use a hypotenuse-inclusive tool for that variant. The assumptions panel above states this plainly: the two inputs are always the legs of the 90° corner.
Quick mental checks
- The hypotenuse must always be longer than either leg — if you ever see otherwise, something is wrong.
- The two angles must sum to 90 degrees.
- Doubling both legs quadruples the area, doubles the perimeter, and leaves both angles unchanged — because angles depend only on the ratio a/b.
- Equal legs (a = b) always produce a 45–45–90 triangle, with hypotenuse a × sqrt(2) and both angles exactly 45 degrees.
That last rule is a lovely sanity check: slide both legs to 10 and the tool should report angles of 45.00 and 45.00, a hypotenuse near 14.14, a perimeter near 34.14, and an area of exactly 50.
Closing summary
One square corner and two legs are enough to know everything about a triangle. The Pythagorean theorem delivers the hypotenuse, arctangent converts the leg ratio into the first angle and subtraction into the second, and the two simplest formulas in geometry produce perimeter and area. The five outputs of this calculator are therefore not five separate results but one shape seen from five directions. Whether you are checking a ladder angle, estimating a gable, or verifying trigonometry homework, the numbers on this page will match the geometry of the world around you — because that geometry is, at its root, a stack of right triangles.