← Home

📐 Pythagorean Theorem Calculator

Solve right triangles with the Pythagorean theorem. Enter any two sides — legs a and b or hypotenuse c — and the missing side is calculated instantly.

Leave the side you want to find blank.

What is this tool?

The Pythagorean theorem is one of the oldest and most useful results in geometry. It states that in any right triangle, the square of the length of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the other two sides. Written as a formula, that is a² + b² = c², where a and b are the two legs and c is the hypotenuse. This single relationship lets you find any unknown side as long as you know the other two. This calculator handles all three cases automatically: leave side a blank to solve for it, leave side b blank to solve for the other leg, or leave the hypotenuse c blank to solve for the longest side. It validates your input to make sure the values can actually form a right triangle — for example, the hypotenuse must always be the longest side, so entering a leg longer than the given hypotenuse is flagged as invalid rather than silently producing an impossible answer. Everything runs locally in your browser. There is no server, no upload and no stored history, so the measurements you enter are completely private. The result is shown to several decimal places and you can recalculate instantly by changing any value.

How it works

When the hypotenuse c is the unknown, the calculator computes c = √(a² + b²): it squares each leg, adds them together and takes the positive square root. When one of the legs is the unknown — say side a — it rearranges the formula to a = √(c² − b²): it squares the hypotenuse, subtracts the square of the known leg, and takes the square root of the difference. The same logic applies to side b. Before calculating, the tool checks the inputs. Both filled-in sides must be positive numbers, and when solving for a leg the known hypotenuse must be larger than the known leg; otherwise the value under the square root would be negative and no real triangle could exist. These checks prevent meaningless or imaginary results and guide you toward valid input.
Ad

How to use

  1. Enter the length of side a if you know it (otherwise leave it blank).
  2. Enter the length of side b if you know it (otherwise leave it blank).
  3. Enter the length of the hypotenuse c if you know it (otherwise leave it blank).
  4. Press Calculate to find the missing side.
  5. Read the result and adjust any value to recalculate.

Frequently Asked Questions

Frequently Asked Questions

Which side should I leave blank?
Leave blank exactly the side you want to find. If you know both legs (a and b), leave the hypotenuse c blank to solve for the longest side. If you know the hypotenuse and one leg, leave the other leg blank.

Why did I get an error message?
The most common cause is entering a leg that is longer than the hypotenuse. In a real right triangle the hypotenuse is always the longest side, so such input is mathematically impossible. Make sure the hypotenuse value is larger than the leg you provided, and that all numbers are positive.

Does this work with decimals?
Yes. The calculator accepts whole numbers and decimals alike, and the result is displayed with several decimal places of precision. You can use values such as 3.5, 0.75 or 12.25 without any special formatting.

What is the hypotenuse exactly?
The hypotenuse is the side of a right triangle that lies directly opposite the right angle. It is always the longest of the three sides, and it is the side whose square equals the sum of the squares of the other two sides according to the Pythagorean theorem.

Tips & Advice

The most famous right triangle is the 3-4-5 triangle, where 3² + 4² = 5² (9 + 16 = 25); carpenters and builders still use multiples of this triangle to lay out perfectly square corners. When solving for the hypotenuse, double-check that your two legs are indeed perpendicular — the theorem only holds for right triangles. If the number under the square root is very close to zero, the two input sides are almost equal, which usually means you have entered the same value for the hypotenuse and a leg by mistake. For construction and DIY projects, round the result to a practical precision (such as the nearest millimetre or sixteenth of an inch) rather than using every decimal place. The calculator is also a quick way to verify that a set of three measurements can actually form a right triangle before you cut any material.

Related Tools

Ad