Pythagorean Theorem Calculator
Enter any two sides of a right triangle and get the third - the hypotenuse from two legs, or a missing leg from the hypotenuse. Shows the a² + b² = c² working, plus area and perimeter.
- Free, no account
- No watermark
- No usage limit
About the Pythagorean Theorem Calculator
Type any two sides of a right triangle and this calculator gives you the third one as you type, with no button to press. What separates it from a plain hypotenuse calculator is that it solves both ways. Give it the two legs and it returns the hypotenuse. It also runs the harder direction, where you know the hypotenuse and one leg and need the other leg, which is exactly the case a forward-only tool makes you rearrange the formula for yourself.
It shows the work too. Every line of the a² + b² = c² substitution, your values plugged in, each square worked out, down to the final square root. If you're doing this for homework you can copy those lines straight onto the page. Most calculators hand you a bare 5 and leave you to reconstruct how they got there.
You get more than the missing side, as well. Alongside the answer it reports the triangle's area, its perimeter, and both acute angles, so if the side was only half of what the problem needed, the rest is already sitting there.
This only works on right triangles, the ones with a real 90 degree corner. That restriction bites harder than it sounds, and there's a section on why below.
How to use
- Pick your mode. The two buttons at the top decide what you're solving for. Choose "I know both legs" when you have the two short sides and want the long one. Choose "I know the hypotenuse + a leg" when you already have the long side and need one of the shorter ones.
- Type your two sides. In legs mode that's leg a and leg b. In the other mode it's the hypotenuse c and whichever leg you know. Decimals work, so
2.5gives you two and a half. - Read the answer. The missing side shows up big at the top of the result panel the moment both boxes have numbers in them. It's live, so there's no calculate button to hit.
- Check the working. Under the answer the tool spells out each step of the substitution, ending on the final square root.
- Grab the extras. Area, perimeter, and the two acute angles sit right below the answer.
- Try a preset. The buttons at the bottom (3, 4 → 5 and friends) load a worked example in one click, handy for seeing the tool run before you trust it with your own numbers.
Whatever unit you measure in, inches, meters, feet, use the same one for every side. The answer comes back in that unit and the area in that unit squared. The tool doesn't convert, so mixing feet and inches will quietly wreck the result.
Solving backward, and the mistake it catches
The reverse mode is where the tool does the most for you, and it's also where people make the one error worth warning about ahead of time. To find a missing leg you rearrange a² + b² = c² so the unknown sits alone, which turns the plus into a minus:
leg = √(c² − known leg²)
That minus sign is the catch. Subtraction can go negative, and the square root of a negative number isn't a real length. Say you meant to enter a hypotenuse of 13 and a leg of 5, but your fingers slipped and you typed 5 as the hypotenuse and 13 as the leg. Now the tool is being asked for √(25 − 169), which is √(−144). Plenty of basic calculators just print NaN, or "Error", and leave you squinting at the screen wondering what you broke.
Ours catches it and tells you plainly that the hypotenuse has to be the longest side, so you've probably swapped two numbers. Swap them back and it solves cleanly, that's usually the whole fix. A swapped hypotenuse is far and away the most common way this goes wrong, so having the tool name the problem instead of just printing NaN saves you the guessing every time.
Right triangles only, and why that trap is sneaky
This is the limit that genuinely matters, and it's dangerous because breaking it sets off no alarm. The Pythagorean theorem only holds when one angle is exactly 90 degrees. Hand it a triangle with angles of, say, 70, 60 and 50, and a² + b² lands nowhere near c².
The trap is that the tool can't see your angles. It only sees the two numbers you type and squares them, no matter what shape your triangle actually is. It hands back a wrong number that looks perfectly reasonable, and nothing on screen tips you off. So before you trust any answer here just confirm your triangle really does have a square corner. If it doesn't, you want the law of cosines instead, the general rule that the Pythagorean theorem is one special case of.
The 3-4-5 trick for checking a square corner
There's a version of the theorem that runs backward as a test, and builders lean on it constantly. If you measure all three sides of a triangle and find that a² + b² does equal c², then the corner has to be a right angle, guaranteed. That's the converse, and it's probably the most useful real-world job this piece of math does.
On a job site it shows up as the 3-4-5 rule. To check that a corner is truly square, measure 3 feet out along one edge, measure 4 feet along the other, then measure the diagonal between those two marks. If that diagonal is exactly 5 feet, the corner is a perfect 90 degrees. If it comes back 4.9 or 5.1, the corner is off, and you nudge it until the diagonal hits 5. Foundations, deck frames, tile layouts, fence lines, all squared with nothing more than a tape measure and those three numbers. The presets in the tool (3, 4 → 5 and the rest) are exactly these clean whole-number triangles, which is why they drop into place in one click.
Frequently asked questions
How is this different from the distance formula?
The distance formula is just the Pythagorean theorem applied to two points, so this tool doubles as a distance finder. The distance between two points (x₁, y₁) and (x₂, y₂) is √[(x₂ − x₁)² + (y₂ − y₁)²]. The horizontal gap between the points is one leg, the vertical gap is the other leg, and the straight-line distance is the hypotenuse. Work out those two gaps, enter them as leg a and leg b in "I know both legs" mode, and the hypotenuse it returns is your distance.
Can I use it for the diagonal across a 3D box?
Not in one step, since the tool works with flat triangles, but you can chain it. First find the diagonal across the floor of the box, using its length and width as the two legs. Then run the tool again with that floor diagonal as one leg and the box's height as the other. The second hypotenuse is the full corner-to-corner diagonal through the box. It's the theorem applied twice, which is exactly how the 3D version is built.
What are Pythagorean triples, exactly?
They're sets of three whole numbers that satisfy a² + b² = c² with no decimals anywhere, like 3-4-5, 5-12-13, and 8-15-17. People memorize the small ones because recognizing one lets you skip the calculation entirely, and they turn up all the time in tests and construction. Scale any triple by a whole number and it stays valid, so 3-4-5 doubled becomes 6-8-10, which still checks out (36 + 64 = 100).
How precise are the answers, and does it round?
It keeps enough significant figures to stay accurate and trims trailing zeros so the number reads cleanly. A clean triple like 3-4-5 shows an exact 5, while an irrational result such as √2 shows about 1.414213562. The two angles are rounded to one decimal place, which is plenty for real work. If your task needs a particular rounding, to the nearest inch for instance, round the displayed value yourself.
Do the two acute angles always add up to something?
Yes, they always sum to 90 degrees. A right triangle already spends 90 of its 180 total degrees on the square corner, which leaves 90 to split between the other two angles. So the tool reports both, and you can always sanity-check them by adding them, if they don't come to 90 something is off. The bigger angle sits opposite the longer leg, which is a quick way to tell which is which.
Does anything I enter get uploaded?
No. Every square and square root happens on your own device, and nothing you type is sent to a server or stored anywhere. That's why the answer appears the instant you finish typing, there's no round trip to wait on. Once the page has loaded you can run the whole thing offline.