Two sides in, the third side out — with the squares shown

A ladder leans against a wall. A rafter spans half the attic. A boat sailed east and then north. Every one of these is secretly a right triangle asking for its missing side, and the Pythagorean theorem is the 2,500-year-old key that opens all of them. This calculator applies it in both directions: give it two legs and it finds the hypotenuse, or give it the hypotenuse and one leg and it finds the other — squares, subtraction, and square root all written out so you can follow every move.

Speed matters less here than trust. Anyone can type 3 and 4 into a phone and get 5; the value of a tool like this is showing that 9 + 16 = 25, that the 25 is an area, and that the square root lands on exactly 5 — no rounding, no mystery. When the answer isn't clean, like legs of 7 and 10 producing √149, you see precisely where the decimal comes from and how it was rounded.

It runs in your browser, free, with nothing to install and nothing uploaded. Geometry homework, job-site layout, game-level design — the tool doesn't care, and it never stores what you type.

What a² + b² = c² actually says

Strip the symbols and the theorem says something almost rural: if you build a square on each side of a right triangle, the two smaller squares hold exactly as much area as the big one. With legs of 3 and 4, the small squares cover 9 and 16 units of area, and the square on the hypotenuse covers 25 — a perfect handoff of space. That is why the equation uses squares of sides rather than the sides themselves, and why square roots close the loop when you solve for a length.

Three vocabulary points prevent most confusion. The legs (conventionally a and b) are the two sides that meet at the right angle. The hypotenuse (c) is always opposite the right angle and is always the longest side — never the shortest, never equal to a leg. And the 90° angle is a strict requirement, not a suggestion; drop it and the equation stops being true.

  • Solve for the hypotenuse: c = √(a² + b²) — two legs in, longest side out.
  • Solve for a missing leg: b = √(c² − a²) — hypotenuse and one leg in, the other leg out.
  • The hypotenuse is strictly greater than either leg but strictly less than their sum.
  • Areas, not lengths, are what balance: 3² + 4² means 9 + 16, an area of 25 before the root.

Why is the right angle so load-bearing? Try a triangle with sides 4, 5, and 8: the two short sides square to 16 and 25, summing to 41, while the long side squares to 64. The areas refuse to balance because the angle opposite the 8 is obtuse — push the sides further apart and the long side grows past the theorem's reach; pull them to exactly 90° and it lands precisely on c². The right angle is the hinge that makes the area handoff exact, which is why Euclid states the proposition as a fact about squares on the sides, not just about lengths.

How to use the Pythagorean Theorem Calculator

One decision matters before any typing: which side is missing? The tool's two modes exist because the arithmetic differs — addition for the hypotenuse, subtraction for a leg.

  1. Pick your mode

    Choose hypotenuse mode if you know the two legs, or leg mode if you know the hypotenuse plus one leg. The input labels change to match so there is no ambiguity about what goes where.

  2. Enter the two known sides

    Any positive numbers work — whole numbers, decimals, measurements like 12.5. Keep the units consistent across both entries; the output comes out in whatever unit you fed in.

  3. Read the worked solution

    The steps show each side squared, the addition or subtraction, and the square root evaluated — for legs 5 and 12 you'll see 25 + 144 = 169, then √169 = 13.

  4. Check the triple flag

    If your three sides form a whole-number Pythagorean triple, the tool names it — handy for recognizing 6-8-10 as the 3-4-5 family in disguise.

  5. Sanity-check the triangle

    The output confirms the hypotenuse exceeds both legs and the sides satisfy the triangle inequality before it presents the answer, catching swapped inputs automatically.

  6. Copy or convert as needed

    Grab the result with its units, or keep it on screen while you adjust measurements to compare layouts — every change recomputes instantly.

A pattern worth adopting for homework: run the problem, then flip the mode and feed the answer back. Compute the hypotenuse of 5 and 12 to get 13, then enter hypotenuse 13 with leg 5 and confirm the missing leg returns 12. Each mode checks the other — the addition path and the subtraction path must agree, and when they do, your triangle is verified from both directions. Two runs, ten seconds, zero lingering doubt.

The two solving modes, side by side

Hypotenuse mode is pure assembly. Square both legs, add, take the root: legs 8 and 15 become 64 + 225 = 289, and √289 = 17. Nothing subtracts, and the answer is always longer than either input — a useful gut check when your fingers type faster than your brain.

Leg mode runs in reverse and subtracts first. Given c = 13 and a = 5, the missing leg is b = √(169 − 25) = √144 = 12. The subtraction is where a hidden mistake lives: if the number under the root comes out negative, you entered a leg larger than the hypotenuse, which no right triangle allows. The calculator flags this instead of silently taking a root of a negative number.

A quick coherence test for any right triangle, worth internalizing: the hypotenuse squared should equal the sum of the leg squares, and the hypotenuse itself should sit between the longer leg and the sum of both. Run it mentally on 5-12-13 — 13 is more than 12 and less than 17, and 169 = 25 + 144 — and you have a triangle that is provably right before any tool touches it.

Worked examples with verified arithmetic

Every figure below checks out by hand — square it yourself if you want the full experience, then run the same numbers through the calculator and compare.

Classic 3-4-5, from legs

Input

a = 3, b = 4

Output

c = √(3² + 4²) = √(9 + 16) = √25 = 5
Rafter length: 5 and 12 across the attic

Input

a = 5 ft rise, b = 12 ft half-span

Output

c = √(25 + 144) = √169 = 13 ft rafter
Missing leg from hypotenuse 13 and leg 5

Input

c = 13, a = 5

Output

b = √(169 − 25) = √144 = 12
Non-triple legs: 7 and 10

Input

a = 7, b = 10

Output

c = √(49 + 100) = √149 ≈ 12.21

Notice what the examples cover between them. Two of them land on whole numbers because the inputs form famous triples — carpenters stake buildings on 3-4-5 and roofers cut 5-12-13 rafters all day. The third reverses direction, solving for a leg with a subtraction. And the fourth produces √149 ≈ 12.21, a reminder that clean answers are the exception in nature, not the rule; the calculator rounds only at the final display and shows the exact radical beside it.

One more with real consequences: a ladder whose base sits 6 feet from a wall it must reach 8 feet up. The ladder is the hypotenuse, so it needs √(36 + 64) = √100 = 10 feet. Safety guidance adds the lean angle rule — base at one-quarter of the ladder's working length — but the geometry underneath is exactly this theorem doing its job.

Pythagorean triples: the cheat codes worth memorizing

A Pythagorean triple is a set of three whole numbers satisfying the theorem exactly, and they are the shortcuts that keep job sites and classrooms moving. Memorize the first several and you stop reaching for a calculator at all in the common cases.

TripleCheckWhere you'll meet it
3-4-59 + 16 = 25Squaring building corners; the carpenter's rule
5-12-1325 + 144 = 169Roof pitch 5-in-12 and rafters
8-15-1764 + 225 = 289Ladder placements and ramps
7-24-2549 + 576 = 625Larger layouts and survey stakes
20-21-29400 + 441 = 841Big frames where both legs are near-equal
9-40-4181 + 1600 = 1681Tall, narrow triangles and masts

Multiplying a triple by any whole number yields another valid one: 6-8-10, 9-12-15, and 30-40-50 are all the 3-4-5 skeleton scaled up, which is why a crew with a 100-foot tape can square a foundation using 30-40-50 without any math at all. The calculator recognizes scaled families too and names the primitive triple underneath your inputs.

There is even a formula that manufactures every primitive triple from two numbers. Pick whole numbers m and n with m greater than n: the sides m² − n², 2mn, and m² + n² always form a triple. With m = 2 and n = 1 that's 3, 4, 5; with m = 3 and n = 2 it's 5, 12, 13; with m = 4 and n = 1 it's 15, 8, 17. Euclid's formula, it's called, and it is why the table above never runs out of rows — the supply is literally infinite.

The converse: turning the theorem into a squareness test

The theorem's less famous twin might be more useful on a construction site. The converse says that if a triangle's sides satisfy a² + b² = c², then the angle between a and b is exactly 90°. Measure, check the numbers, and you have proven the corner is square without ever touching a protractor.

That is the entire logic of the 3-4-5 rule. A framer marks 3 feet along one plate, 4 feet along the perpendicular candidate, and measures between the marks: 5 feet means square, anything else means adjust. Tradition holds that ancient Egyptian rope-stretchers used knotted cords in the same 3-4-5 pattern to re-establish field boundaries after Nile floods — the earliest known quality control built on this equation.

Scaling the check is routine on real sites because tolerances do not scale. A framing crew that would accept a quarter-inch gap on a 3-4-5 test cannot accept one on 30-40-50 — the same proportional error spreads over ten times the distance. The math is identical; the stakes and the tape reading both grow. That is exactly when pulling out a calculator beats mental arithmetic: bigger triangles magnify both the pattern and the slop.

From Babylonian clay to a president's proof

Pythagoras of Samos lived around 570–495 BC, but the equation beat him to the world by more than a millennium. The Babylonian tablet Plimpton 322, dated to roughly 1800 BC, lists fifteen Pythagorean triples in cuneiform — pre-Greek scribes were cataloging these number patterns over a thousand years before Pythagoras was born. The theorem's name honors the tradition rather than the discovery date.

The proof collection is the fun part. Euclid's Elements presents it as Proposition I.47 around 300 BC with a diagram schoolchildren still meet. In 1876, US Congressman — and future president — James Garfield published his own proof built on a trapezoid, apparently worked out in geometry conversations with colleagues. By the twentieth century, teacher Elisha Loomis had gathered 367 distinct proofs in his book The Pythagorean Proposition, ranging from algebraic rearrangements to arguments via similar triangles. Few statements in mathematics have attracted that much creative attention.

Where people get it wrong

Short equations concentrate their failure modes, and this one is no exception: the errors fall into a few repeated habits. Each one below survives in thousands of graded papers every year.

  • Entering the hypotenuse in leg mode — the subtraction then goes negative under the root, and the correct response is re-reading the problem, not ignoring the sign.
  • Adding legs without squaring — 3 + 4 = 7 is a sum of lengths, not areas, and it is not the hypotenuse of anything.
  • Applying the theorem to non-right triangles — a triangle with sides 4, 5, and 8 exists but has no 90° angle, so the equation simply does not apply.
  • Mixing units across inputs — 6 feet and 200 centimeters in one equation compares incompatible areas; convert first, every time.
  • Rounding before the root — squaring 12.21 and rounding inside the calculation stacks error; keep full precision until the final step, which the tool does automatically.
  • Swapping which side is longest — the hypotenuse is opposite the right angle and is always the largest of the three; if your computed c is shorter than a leg, an input is in the wrong box.

Who uses this every week

Geometry class is the obvious venue, but the theorem's job site roster is long and specific.

  • Carpenters and framers — squaring wall corners and foundations with the 3-4-5 rule, scaled up to 30-40-50 for full-size buildings.
  • Roofers — a roof rising 5 feet over a 12-foot half-span needs a 13-foot rafter per bay, the 5-12-13 triple doing quiet structural work.
  • Students and teachers — the theorem anchors most right-triangle units in middle and high school, and every standardized test circles back to it.
  • Navigators and drone pilots — flying 8 miles east then 15 miles north puts you exactly 17 miles from start, the straight-line answer the theorem delivers instantly.
  • Game and graphics developers — on-screen distances between sprites are hypotenuses computed in millions of frames per second, the same formula with faster hardware.
  • TV shoppers — a screen 48 inches wide and 27 tall has a √(2304 + 729) ≈ 55-inch diagonal, which is how 16:9 television sizes get their names.
  • Homeowners and flooring installers — the diagonal of a 10-by-12-foot room runs √(100 + 144) = √244 ≈ 15.62 feet, the number tile setters use to confirm a subfloor is square before the first tile goes down.

Tool versus the alternatives

Four realistic options exist for solving a right triangle, and they trade speed against visibility differently.

MethodSpeedShows the squaresCatches impossible inputsBest for
This Pythagorean theorem calculatorInstantYes, every stepYes, both modesHomework, layout checks, quick design
By hand with pencilA minute or twoWhatever you writeOnly if you checkExams and building fluency
Scientific calculatorFastNo — single number outNoTrusting users with known-good inputs
CAD or geometry softwareSlower to set upSometimes, via construction historyUsuallyDesign work needing full drawings

The scientific calculator row is worth a pause: it will happily compute √(−23) territory or accept a hypotenuse smaller than a leg without complaint. Software correctness is not the same as software honesty about what you typed, and the difference shows up exactly when inputs are wrong.

Honest limits of the tool

Scope first: this calculator solves for one missing side of a right triangle, and that is the whole job. It does not compute angles — for that you want trigonometry, where arctan and friends take over — and it does not validate that your real-world triangle is actually right. A wall that looks vertical but leans two degrees will produce a mathematically perfect answer for a triangle that does not exist, and no tool can see the lean.

Measurement precision deserves a mention too. Real inputs carry error — a tape read to the nearest eighth of an inch — and the missing side inherits and amplifies it, especially in leg mode where subtraction can leave a small, uncertain difference under the root. For job-critical cuts, cut long and trim: geometry forgives more than lumber does.

Frequently asked questions

The questions below come straight from what people search about this theorem, answered in plain terms.

How do I find the hypotenuse of a right triangle?

Square both legs, add the results, and take the square root: c = √(a² + b²). For legs of 5 and 12, that's √(25 + 144) = √169 = 13. Enter the two legs in hypotenuse mode and the calculator does exactly this with the steps shown.

How do I find a missing leg when I know the hypotenuse?

Rearrange the theorem: b = √(c² − a²). Square the hypotenuse, square the known leg, subtract, and take the square root. With c = 13 and a = 5, that's √(169 − 25) = √144 = 12.

What is the Pythagorean theorem formula?

a² + b² = c², where a and b are the two legs of a right triangle and c is the hypotenuse — the side opposite the 90° angle. The relationship is really about area: the squares built on the two short sides have combined area equal to the square on the long side.

What are Pythagorean triples?

Whole-number sets that satisfy a² + b² = c² exactly: 3-4-5, 5-12-13, 8-15-17, 7-24-25, 9-40-41, 20-21-29. Multiples of triples work too — 6-8-10 is just 3-4-5 doubled. The calculator flags when your inputs form one.

How do carpenters use the 3-4-5 rule?

Measure 3 units along one wall and 4 along the other from the same corner; if the diagonal between those marks measures exactly 5, the corner is square. It works because the converse of the theorem holds: sides satisfying 3² + 4² = 5² force a 90° angle between them.

Does the Pythagorean theorem work for any triangle?

No — only right triangles, because the 90° angle is what makes the equation balance. For other triangles you need the law of cosines, which generalizes this theorem and reduces to it exactly when the angle is 90°.

Can the hypotenuse come out as a decimal?

Absolutely. Legs of 7 and 10 give c = √149 ≈ 12.21, and most real measurements land on irrational square roots. Whole-number answers happen only when the sides form a Pythagorean triple.

What if my sides are in different units?

Convert everything to one unit before entering values — the equation compares areas, so mixing feet with meters produces garbage. A 6-foot base and an 8-foot wall need a 10-foot ladder, but a 6-foot base with a 2-meter wall is nonsense until one unit is converted to the other.

Sources and further reading

The history, the triples, and the construction practice all trace to documentable references.

Sources and further reading

  • Euclid's Elements, Book I, Proposition 47 (D. Joyce's edition) — https://mathcs.clarku.edu/~djoyce/java/elements/bookI/propI47.html (the classical proof with the square-area construction)
  • Encyclopaedia Britannica, Pythagorean theorem — https://www.britannica.com/science/Pythagorean-theorem (statement, converse, and historical attribution)
  • Wolfram MathWorld, Pythagorean Theorem — https://mathworld.wolfram.com/PythagoreanTheorem.html (formal statement and proof references, including Garfield's trapezoid proof of 1876)
  • Wolfram MathWorld, Pythagorean Triple — https://mathworld.wolfram.com/PythagoreanTriple.html (the standard triples table and how scaled families derive from primitive triples)
  • MacTutor History of Mathematics, Pythagoras of Samos — https://mathshistory.st-andrews.ac.uk/Biographies/Pythagoras/ (biographical dates and the Babylonian Plimpton 322 context)

We cite primary sources (standards bodies, government agencies, official documentation) wherever they exist so you can verify every number on this page yourself.