a² + b² = c²
Pythagorean Theorem Calculator
Enter any two of the three sides — both legs, or one leg and the hypotenuse — to find the missing side instantly.
Find the missing side of a right triangle
This tool is restricted to the three side lengths only — no angles, altitude, area, or perimeter — so it's a focused, no-distraction Pythagorean theorem solver. It's pre-loaded with the rafter of a 5/12 roof: a 5 ft rise and a 12 ft run, the 5-12-13 triple.
Results
5-12-13 Pythagorean triple- Leg a
- 5 ft
- Leg b
- 12 ft
- Hypotenuse c
- 13 ft
- Angle α
- 22.6199°
- Angle β
- 67.3801°
- Altitude h
- 4.6154 ft
- Area
- 30 ft²
- Perimeter
- 30 ft
- Inradius
- 2 ft
- Circumradius
- 6.5 ft
Step-by-step solution
The working keeps extra decimal places so you can check it by hand. Answers are rounded to your chosen decimal places.
- Apply the Pythagorean theoremc = √(a² + b²)c = √(5² + 12²)= 13 ft
- Find angle αα = arctan(a / b)α = arctan(5 / 12)≈ 22.6199°
- Find angle ββ = 90° − αβ = 90° − 22.619865°≈ 67.3801°
- Compute the areaArea = (1/2)·a·bArea = (1/2)·
5· 12 = 30 ft² - Compute the perimeterP = a + b + cP = 5 + 12 + 13= 30 ft
- Compute the altitude to the hypotenuseh = (a·b) / ch = (5·
12) / 13 ≈ 4.6154 ft - Inradius (radius of the inscribed circle)r = (a + b − c) / 2r = (5 + 12 − 13) / 2= 2 ft
- Circumradius (radius of the circumscribed circle)R = c / 2R = 13 / 2= 6.5 ft
The Pythagorean theorem, explained
The Pythagorean theorem states that in any right triangle, the sum of the squares of the two legs equals the
square of the hypotenuse: a² + b² = c². It's named for the ancient Greek mathematician Pythagoras,
though the relationship was known and used by Babylonian and Indian mathematicians centuries earlier — it is
one of the oldest and most-proven theorems in all of mathematics, with hundreds of distinct known proofs.
The theorem is useful precisely because it lets you find a missing side without measuring it directly. Rearranged
for each side, it becomes: c = √(a² + b²) when both legs are known; a = √(c² − b²)
when the hypotenuse and one leg are known; and symmetrically b = √(c² − a²).
Worked example: the rafter of a 5/12 roof
A roof with a 5/12 pitch rises 5 inches for every 12 inches it runs. On a house 24 ft wide, each rafter covers a
run of 12 ft, from the outside wall to the middle of the ridge, and a rise of 5 ft. The rafter is the
hypotenuse: squaring the legs gives 25 and 144, adding them gives 169, and the square root is exactly 13 ft,
c = √(5² + 12²) = √169 = 13. Add the overhang at the eave before you cut. Because 5, 12, and 13 are
whole numbers satisfying a² + b² = c², this is a Pythagorean triple, the second most common one
after 3-4-5, and the calculator's classification badge flags it automatically.
From there, every other measurement follows the same formulas used throughout this site: area =
(1/2)·5·12 = 30 ft², perimeter = 5 + 12 + 13 = 30 ft (a pleasant coincidence for this
particular triple, since area and perimeter share the same numeric value here, just different units), altitude
to the hypotenuse = (5·12)/13 ≈ 4.615 ft, inradius = (5 + 12 − 13)/2 = 2 ft, and
circumradius = 13/2 = 6.5 ft. The roof's angle is α = arctan(5/12) ≈ 22.62°.
Is it a right triangle? The converse of the Pythagorean theorem
The Pythagorean theorem also works backwards. If the squares of the two shorter sides add up to the square of the longest side, the triangle must be a right triangle. This is the converse of the Pythagorean theorem, and it's how you check whether three lengths form a right angle:
- Call the longest side
cand the other twoaandb. - Work out
a² + b²andc². - If they're equal, it's a right triangle. If
a² + b² > c², it's acute; if smaller, it's obtuse.
For 5, 12, 13: 5² + 12² = 25 + 144 = 169 = 13², so it is a right triangle. For 4, 5, 6:
4² + 5² = 41 but 6² = 36, so it isn't (it's acute). A quick shortcut with the
calculator above: enter the two shorter sides as legs, and if the hypotenuse it returns matches your third
side, the triangle is right-angled. Builders use the same idea to square corners: the
3-4-5 rule calculator works out the triangle and both diagonals for a deck
or a foundation.
When you'd use this calculator
Use this focused version whenever the only information you have is two of the three side lengths — for example, checking whether a rectangular frame, wall corner, or garden bed is truly square by measuring the two sides and the diagonal, or finding a ladder's required length given its base distance from a wall and the height it needs to reach. If you have an angle, an altitude, an area, or a perimeter instead, use the full right triangle calculator, which accepts any two of all eight possible known values. Know an angle instead of a second side? Use the hypotenuse calculator.
Pythagorean theorem FAQ
Do I need all three sides to use the Pythagorean theorem?
No — that would defeat the purpose. You only need two of the three sides. If you know both legs, add their squares and take the square root to get the hypotenuse. If you know the hypotenuse and one leg, subtract the known leg’s square from the hypotenuse’s square and take the square root to get the other leg.
What does it mean if the calculator rejects my hypotenuse and leg values?
It means the leg you entered is greater than or equal to the hypotenuse you entered, which is geometrically impossible — the hypotenuse is always the longest side of a right triangle. Double-check which value is the hypotenuse and try again.
How can I check if three sides make a right triangle?
Square the two shorter sides and add them. If the total equals the square of the longest side, the triangle is a right triangle; if not, it isn’t. For 5, 12, 13: 25 + 144 = 169 = 13², so it is. For 4, 5, 6: 16 + 25 = 41, not 36, so it isn’t.
Does the Pythagorean theorem work for any triangle?
No — it only applies to right triangles. For other triangles, the generalized version is the law of cosines, c² = a² + b² − 2ab·cos(C), which reduces to the Pythagorean theorem exactly when angle C is 90° (since cos(90°) = 0).
See the full right triangle FAQ for more general questions.
Cite this page
To cite this calculator in schoolwork or a report, you can use this reference (APA style):
Right Triangle Calculators. (2026, October 10). Pythagorean theorem calculator. https://righttrianglecalculators.com/pythagorean-theorem-calculator
References
The formulas and definitions on this page match these standard references.
- Weisstein, Eric W. “Pythagorean Theorem.” MathWorld, Wolfram Research.
- Joyce, David E. (ed.) “Euclid’s Elements, Book I, Proposition 47.” Clark University.
- Weisstein, Eric W. “Pythagorean Triple.” MathWorld, Wolfram Research.
Hypotenuse calculator
Find the hypotenuse from two legs, a leg and an angle, the area, or the perimeter.
Right triangle calculator
Find the area, sides, and angles of any right triangle from any 2 known values.
Special right triangle calculator
Solve 30-60-90 and 45-45-90 triangles from a single known side.
30-60-90 triangle calculator
Solve a 30-60-90 triangle from a single known side.
Isosceles right triangle calculator
Solve a 45-45-90 isosceles right triangle from a single known side.
3-4-5 rule calculator
Square a deck, foundation, or room: the diagonal to measure and a check of both diagonals.
Right triangle formulas
Every right-triangle formula in one reference sheet.