Pythagorean Theorem Calculator
Pythagorean theorem calculator that finds the hypotenuse or a missing leg of a right triangle, with exact radicals, step-by-step working and a diagram.
Fill in two sides and leave the unknown one empty. Whole numbers, decimals (2.5) and fractions (3/2) are accepted.
Missing side
–
- Area
- –
- Perimeter
- –
- Angle α (opposite a)
- –
- Angle β (opposite b)
- –
Step by step
How to use the Pythagorean theorem calculator
- Type the two sides you know in Leg a, Leg b and Hypotenuse c, and leave the side you are looking for empty. You can type whole numbers, decimals such as 2.5, or fractions such as 3/2.
- Optionally choose a Unit (mm, cm, m, km, in, ft, yd or mi). It is only added to the answers; the calculation is the same.
- The answer appears as you type (the Calculate button does the same). Missing side shows the decimal value, and Exact value shows the simplified radical when the side is not a whole number or a terminating decimal, for example 5√2.
- Below it you get the Area, the Perimeter and the two acute angles, a note telling you whether the three sides form a Pythagorean triple, and the full working under Step by step.
- The diagram on the right redraws the triangle to scale, with the unknown side dashed and highlighted. Copy copies the answer; Clear empties the three boxes.
The Pythagorean theorem
In a right triangle, the side opposite the right angle is the hypotenuse c, always the longest side. The two other sides, a and b, are the legs. The theorem states that
a² + b² = c²
The square built on the hypotenuse has the same area as the two squares built on the legs combined. Rearranging the formula gives each side:
- hypotenuse: c = √(a² + b²)
- a leg: a = √(c² − b²), or b = √(c² − a²)
Because a leg is found by subtracting, the hypotenuse must be strictly longer than the known leg. If it is not, no right triangle exists and this tool tells you so.
Exact answers with square roots
This tool works with exact fractions, so it can give the answer in simplified radical form instead of only a rounded decimal. With legs 5 and 5, c² = 25 + 25 = 50, and since 50 = 5² × 2, c = √50 = 5√2 ≈ 7.0710678. With a leg of 1 and a hypotenuse of 2, the other leg is √3 and the area is √3/2. Fractions are handled the same way: legs 1/2 and 1/3 give c = √13/6.
The exact form is what teachers usually expect in geometry homework, while the decimal is what you need to cut a board or lay out a wall. The area and perimeter are also given exactly, for example 10 + 5√2 for the perimeter of the 5-5 triangle.
Pythagorean triples
A Pythagorean triple is a set of three whole numbers that satisfy a² + b² = c². The best known are 3-4-5, 5-12-13, 8-15-17 and 7-24-25. A triple is primitive when the three numbers have no common factor. Multiplying a primitive triple by any whole number gives another triple: 6-8-10 is 2 × (3-4-5), and 9-12-15 is 3 × (3-4-5). When all three sides are whole numbers, this tool reports whether they form a primitive triple or a multiple of one.
Triples are handy on building sites: measuring 3 m along one wall, 4 m along the other and checking that the diagonal is exactly 5 m confirms a square corner.
Angles, area and perimeter
Knowing all three sides, the rest of the right triangle follows. The area is half the product of the legs, a × b ÷ 2. The perimeter is a + b + c. The acute angle α, opposite leg a, is arctan(a ÷ b), and the other acute angle is β = 90° − α. For a triangle that is not right-angled, use a general triangle calculator with the law of cosines instead.
Frequently asked questions
Which side is the hypotenuse?
The hypotenuse is the side opposite the right angle and the longest side of the triangle. In this tool it is always c; a and b are the two sides that meet at the right angle.
Can I find a leg instead of the hypotenuse?
Yes. Leave Leg a or Leg b empty and fill in the other leg and the hypotenuse. The tool computes √(c² − b²) or √(c² − a²).
Why do I get a result like 5√2 instead of a decimal?
5√2 is the exact value of √50: the square factor 25 is taken out of the root. The rounded decimal is shown too, so you can use whichever you need.
Why does it say the hypotenuse must be longer?
The hypotenuse of a right triangle is always longer than each leg, because c² = a² + b² is larger than a² and b². If the numbers you typed break that rule, they cannot describe a right triangle.
Does the unit change the result?
No. The unit is only a label added to the lengths and to the area (for example cm²). All the sides must be in the same unit.
What is a primitive Pythagorean triple?
It is a triple of whole numbers with no common divisor, such as 3-4-5 or 5-12-13. Every other triple is a whole multiple of a primitive one.
Related tools
- Triangle Calculator Free triangle calculator that solves any triangle from three values (SSS, SAS, ASA, AAS or SSA), with area, perimeter, heights, steps and a scaled diagram.
- Area Calculator Free area calculator for 11 shapes, from squares and circles to trapezoids, sectors and regular polygons, with the formula, worked steps and a labelled diagram.
- Exponent and Root Calculator Calculate powers with negative or fractional exponents, square, cube and nth roots, and simplify radicals exactly (√72 = 6√2), with the steps shown.