Pythagorean theorem calculator
Choose which side to find, enter the other two and read the answer, with the area, perimeter and angles.
Free · no signup Runs in your browser
How do I use the Pythagorean theorem?
In a right triangle the square of the longest side (the hypotenuse, c) equals the sum of the squares of the other two sides: a² + b² = c². To find the hypotenuse, add the squares of the legs and take the square root: legs 3 and 4 give √(9 + 16) = √25 = 5. To find a leg, subtract: with c = 13 and b = 12, a = √(169 − 144) = 5. Choose the unknown side, enter the other two and the calculator does the rest.
What the theorem says
The Pythagorean theorem links the three sides of any right triangle, one with a 90° angle. The side opposite the right angle is the hypotenuse and is always the longest; the other two are the legs. If you draw a square on each side, the area of the square on the hypotenuse equals the sum of the areas of the squares on the legs. The theorem was known long before Pythagoras in Babylonian and Indian mathematics, and there are hundreds of proofs.
It works the other way as well: if three sides satisfy a² + b² = c², the triangle must be a right triangle. Builders use this with the 3-4-5 rule to check that a corner is square: measure 3 units along one wall and 4 along the other, and the diagonal between those points should be exactly 5. Sets of whole numbers that work, such as 3-4-5, 5-12-13, 8-15-17 and 7-24-25, are called Pythagorean triples, and the calculator flags them. Any multiple of a triple is another triple: 6-8-10, 9-12-15 and so on.
It runs in your browser. Your numbers are never sent anywhere, and there is no sign-up.
Uses beyond triangles
The same formula gives the straight-line distance between two points: with a horizontal distance of 6 and a vertical distance of 8, the distance is √(36 + 64) = 10. It gives the length of a ladder against a wall, the diagonal of a rectangular room or a TV screen (a 1.2 m by 0.7 m screen has a diagonal of 1.39 m), and the length of a rafter for a roof. Keep all sides in the same unit. The angles shown come from the inverse tangent of the opposite side over the adjacent side, and the two acute angles always add up to 90°.
When to use it
- Finding a diagonal, a ladder length or a roof rafter
- Checking that a corner is square
- Homework on right triangles and distance
- Finding the distance between two points on a grid
Mistakes it helps you avoid
- Using the theorem on a triangle that has no right angle.
- Calling a leg the hypotenuse: c is always the longest side.
- Adding the sides instead of their squares.
- Mixing units, such as feet and inches, in one calculation.
The formula
How the answer is worked out.
a² + b² = c², with c the hypotenusehypotenuse: c = √(a² + b²)leg: a = √(c² − b²) or b = √(c² − a²)area = a × b ÷ 2; angle opposite a = arctan(a ÷ b); the other acute angle = 90° − that angle
Results are shown to six decimal places. A hypotenuse must be longer than either leg. The check line shows both sides of the equation from the rounded values.
Example: a 5 m ladder
A 5 m ladder leans on a wall with its foot 1.5 m from the wall. How high does it reach?
- Knownc = 5, b = 1.5
- Heighta = √(25 − 2.25) = √22.75 = 4.77 m
The ladder reaches 4.77 m up the wall
The angle with the ground is 72.5°.
Terms on this page
- Hypotenuse
- The longest side of a right triangle, opposite the right angle.
- Pythagorean triple
- Three whole numbers a, b, c with a² + b² = c².
Common questions
What is the Pythagorean theorem?
In a right triangle, a² + b² = c², where c is the hypotenuse.
Does it work for any triangle?
Only right triangles.
What is a Pythagorean triple?
Three whole numbers that satisfy it, such as 3, 4, 5.
How do I find the distance between two points?
Use the horizontal and vertical differences as the legs.
Is my input uploaded?
No.
Is anything I enter sent to a server?
No. The calculation happens in your browser and nothing you type leaves your device.
Where these numbers come from
- Wikipedia — Pythagorean theorem Statement, proofs and history.
- Wikipedia — Pythagorean triple Whole-number solutions such as 3-4-5.
Last verified 2026-10-25 The method on this page is checked against the sources above at least once a year. Spotted something out of date? Tell us and we will fix it.
Related tools
Quadratic formula calculator
Solve ax² + bx + c = 0 with the quadratic formula: real, repeated or complex roots, the discriminant, vertex and factored form.
Open toolPerimeter calculator
Perimeter and area for every common shape, including irregular polygons.
Open calculatorOctagon calculator
Area, perimeter and both widths — plus the corner setback for cutting one from a square.
Open calculatorCircle skirt
Waist radius, hem radius and how much fabric to buy — for full, three-quarter, half and quarter circles.
Open calculatorPolynomial calculator
Add, multiply and divide polynomials, or find every root including complex ones.
Open calculatorScientific calculator
A free online scientific calculator with trigonometry in degrees, radians or gradians, logarithms, powers, roots, factorials, brackets and history.
Open tool🧮 Maths and science calculators
Homework tools that explain the method rather than just handing over an answer.
See all 30 tools in this section