Pythagorean theorem calculator
Find the hypotenuse or a leg of a right triangle (a² + b² = c²).
How the calculation works
The Pythagorean theorem applies to right triangles (those with a 90° angle). It links the three sides: the two legs (forming the right angle) and the hypotenuse (the longest side, opposite the right angle).
a² + b² = c² (c is the hypotenuse)
Depending on what's missing, isolate the side you need:
- Hypotenuse:
c = √(a² + b²) - Leg:
b = √(c² − a²)
Step by step (legs 3 and 4)
- a² + b² = 9 + 16 = 25
- c = √25 = 5
This is the famous 3-4-5 triangle, used by builders to check a square (90°) corner.
Finding a leg
If the hypotenuse is 13 and a leg is 5: b = √(169 − 25) = √144 = 12. Another classic triple: 5-12-13.
Where it's used
Distance between two points, a ladder against a wall, the diagonal of a rectangle (TV, screen), ramps and roofs — whenever a right angle is involved.
Examples
- Legs 6 and 8: c = √(36 + 64) = √100 = 10.
- Hypotenuse 13, leg 5: other leg = √(169 − 25) = 12.
Frequently asked questions
What is a 3-4-5 triangle?
A classic right triangle: 3² + 4² = 5² (9 + 16 = 25). One of the whole-number "Pythagorean triples".
Does the theorem work for any triangle?
No. Only for right triangles (with a 90° angle). For others, use the law of cosines.
How do I know which side is the hypotenuse?
It is always the side opposite the right angle and the longest of the three. The legs are the two sides forming the 90° angle.
Related calculators
Area of shapes
Calculate the area of a square, rectangle, triangle, circle and trapezoid in seconds.
Power & root
Calculate powers (base raised to an exponent) and roots (square and nth).
Distance between two points
Calculate the distance between two points (x, y) with the distance formula, plus the midpoint.
Triangle (from 3 sides)
Enter the three sides to get the angles, area, perimeter and type of the triangle.
More Math calculators
See all →Scientific calculator
Free online scientific calculator: sine, cosine, tangent, root, power, log, ln, π and parentheses.
Percentage
Calculate percentages every way: X% of Y, increase, discount and percentage change.
Rule of three
Solve a simple rule of three (direct or inverse): enter three values and find the fourth.
Compound rule of three
Solve problems where two quantities vary at once (machines, days, output...), directly or inversely.
Logarithm
Calculate the logarithm of a number in any base, plus natural log (ln), log10 and log2.
Trigonometry (sin, cos, tan)
Calculate the sine, cosine and tangent of an angle in degrees or radians.
Slope / grade
Calculate slope as a percentage, the angle and the ratio from rise and run.
Scientific notation
Convert a number to scientific notation (a × 10ⁿ) and back to decimal form.
Updated on June 18, 2026 · by Rafael Rossi · Methodology & sources