What the Pythagorean theorem says
The Pythagorean theorem is a rule about right triangles: the square of the hypotenuse equals the sum of the squares of the other two sides. Written as a formula, a² + b² = c², where c is the hypotenuse and a and b are the legs. It has been used for over two thousand years, and it still does the same job today — turning two known sides into the third.
The theorem works in both directions. If you know the two legs, you can find the hypotenuse by adding their squares and taking the root. If you know the hypotenuse and one leg, you can find the other leg by subtracting the known leg's square from the hypotenuse's square and taking the root. This calculator does both, and the mode switch at the top chooses which.
It only works for right triangles — triangles with one angle of exactly 90 degrees. For any other triangle the rule is false, and the answers it gives are meaningless. That single condition is the most important thing to check before you use it. Everything on this page runs in your browser, so nothing is uploaded or stored.
Finding a hypotenuse, finding a leg
In hypotenuse mode, the two numbers you type are the legs. The calculator squares both, adds them, and takes the square root. Legs 3 and 4 give √(9 + 16), which is √25, which is 5. The area is half the product of the legs: 3 × 4 ÷ 2, which is 6.
In leg mode, the first number you type is the hypotenuse and the second is the leg you already know. The calculator squares both, subtracts the leg's square from the hypotenuse's square, and takes the root. A hypotenuse of 13 and a known leg of 5 give √(169 − 25), which is √144, which is 12. The area is half the product of the two legs: 12 × 5 ÷ 2, which is 30.
The two modes are the same theorem rearranged. Starting from a² + b² = c², solving for c gives c = √(a² + b²), and solving for b gives b = √(c² − a²). The calculator does the rearranging for you — you only have to say which side is missing. A triangle calculator solves the whole triangle when you need the angles as well as the sides.
The mode switch: the setting people get wrong
The mode switch changes what side a means, and that is where most mistakes happen. In hypotenuse mode, a is a leg — one of the two short sides. In leg mode, a is the hypotenuse — the longest side. The same box holds a different side depending on the mode, so read the label under the switch before you type.
A quick check catches the error. In leg mode, a must be larger than b, because the hypotenuse is the longest side of the triangle. If you type a 5 and b 13 in leg mode, the calculator returns nothing — a hypotenuse of 5 cannot contain a leg of 13. Swap the numbers and it works: a 13 and b 5 gives a missing leg of 12.
In hypotenuse mode there is no such check, because any two positive legs make a valid right triangle. The habit to build is simple: decide which side is missing first, set the mode, then type the numbers. If the answer comes back blank, the mode and the numbers disagree — check which side you put in box a. The square root calculator shows the root step on its own if you want to follow the arithmetic.
Worked examples: 3-4-5 and 5-12-13
First example, hypotenuse mode. Legs 3 and 4. Square them: 9 and 16. Add: 25. Square root: 5. The missing side is 5, the area is 6, and the known side b is 4. This is the 3-4-5 triangle, the most famous triple in geometry, and it is the default on this page.
Second example, leg mode. Hypotenuse 13, known leg 5. Square them: 169 and 25. Subtract: 144. Square root: 12. The missing leg is 12, the area is 12 × 5 ÷ 2, which is 30, and the known side b is 5. This is the 5-12-13 triple, the second famous one.
Third example, hypotenuse mode again, with numbers that are not a triple. Legs 5 and 12 give √(25 + 144), which is √169, which is 13 — actually a triple after all, since 5, 12 and 13 fit the theorem exactly. For a genuinely non-triple case, legs 2 and 3 give √13, which is 3.61, and an area of 3. The calculator does not care whether the answer is neat; the geometry is the same either way.
Who uses the Pythagorean theorem
Builders use it to square corners and set out foundations. The 3-4-5 check — mark 3 units one way, 4 the other, and confirm the diagonal is 5 — proves a corner is a right angle without a single instrument. The leg mode is used in reverse: given a diagonal and one wall, find how long the other wall must be.
Surveyors, carpenters, and roofers use it daily. A roof's slope length is the hypotenuse of the rise and the run. A staircase stringer is the hypotenuse of the total rise and the total going. A ramp's length is the hypotenuse of its height and its horizontal length. Anywhere a diagonal crosses a rectangle, the theorem is doing the work.
At home, the theorem sizes diagonals for furniture and screens. A television quoted as 55 inches is 55 inches on the diagonal, and a shelf that must fit diagonally through a doorway is a hypotenuse problem: the doorway height and width are the legs, and the longest board that fits is their hypotenuse. Measure the doorway, run the numbers, and the board either fits or it does not.
Students meet it as the first real theorem of geometry, and it stays useful far beyond school. Navigation, screen sizes, and distance calculations all reduce to right triangles. The area result on this page pairs with the triangle area calculator when the triangle is not right-angled and the base-height method is needed instead.
Pythagorean theorem vs the triangle area formula
The theorem finds a missing side; the area formula finds the space inside. They use the same numbers but answer different questions. For legs 3 and 4, the theorem says the hypotenuse is 5, and the area formula says the triangle covers 6 square units. Neither replaces the other, and this calculator shows both at once because they are so often needed together.
The area of a right triangle is especially simple: half the product of the legs. That is because a right triangle is exactly half of the rectangle built on its legs — a 3 by 4 rectangle has area 12, and the triangle that is half of it has area 6. For a triangle that is not right-angled, the area needs a base and a height, or all three sides with Heron's formula.
The theorem also has a famous converse that is easy to forget: if a² + b² = c² for the three sides of a triangle, then the triangle is right-angled. That is what makes the 3-4-5 check work on a building site — the numbers prove the angle, not the other way round. A slope calculator covers the related question of how steep a line is, which is the same triangle read as a gradient.
Common Pythagorean theorem mistakes
The first mistake is using the wrong mode: typing the hypotenuse into box a while the calculator is in hypotenuse mode. The calculator then treats the hypotenuse as a leg and returns a number that is too big. Set the mode first, then type.
The second mistake is adding the squares when you should subtract, or the other way round. Finding a leg means subtracting: c² − a². Finding a hypotenuse means adding: a² + b². The sign follows from which side is missing, and the mode switch exists precisely so you do not have to remember it.
The third mistake is forgetting the square root — answering 25 when the hypotenuse is 5. The fourth is using the theorem on a triangle with no right angle. The fifth is mixing units. All five are caught by one habit: sketch the triangle, label the right angle, mark the known sides, and only then calculate.
How to use this Pythagorean theorem calculator
First, choose the mode. Pick hypotenuse if you know both legs and want the longest side. Pick missing leg if you know the hypotenuse and one leg. Then type side a and side b — remembering that in leg mode, side a is the hypotenuse and must be the larger number.
The missing side appears as the headline result, with the triangle area and the known side b underneath. For the default legs of 3 and 4, the missing side is 5 and the area is 6. Switch to leg mode, type 13 and 5, and the missing leg is 12 with area 30.
Everything runs in your browser. No account, no sign-up, no data sent anywhere. If the result comes back blank, check the mode and check that side a is larger than side b in leg mode — one of those two is almost always the cause.