To calculate the Pythagoras theorem in Excel, type =SQRT(A2^2+B2^2) into any cell where A2 and B2 hold the two legs of a right triangle, and the cell displays the hypotenuse; for a missing leg, type =SQRT(C2^2-A2^2) with C2 as the hypotenuse and A2 as the known leg. The Pythagorean theorem states that in any right triangle — one containing exactly one 90° angle — the square of the hypotenuse equals the sum of the squares of the other two sides, written a² + b² = c². In Excel the squaring is done with the caret (^) operator and the square root with the SQRT function, so no add-ins, VBA macros, or helper columns are needed. Most people put the two known sides in adjacent cells, drop the formula into a third cell, and copy it down for a long list of triangles in one go. That approach is fine for a handful of values, but the moment the area, perimeter, and both acute angles are also wanted, the spreadsheet starts to need extra columns. The Pythagorean Theorem Calculator removes that setup entirely by accepting the two known lengths in input boxes and returning every related value at once.

The Pythagorean Formula in a Spreadsheet
Every right triangle has three sides that relate through a² + b² = c². The two shorter sides, called the legs, meet at the 90° angle, and the longest side, the hypotenuse, sits opposite it. Knowing any two of these three lengths fixes the third, which is why the theorem fits so well in spreadsheets: type two values, write one formula, and the third side appears. The caret is Excel's exponent operator, so A2^2 squares the value in cell A2 and A2^3 would cube it. SQRT takes the non-negative square root, which is exactly what is needed because a length cannot be negative. Together, =SQRT(A2^2+B2^2) mirrors the textbook rearrangement c = √(a² + b²) exactly, and any version of Excel from 2007 onward evaluates it the same way. There is no need for the older SUMSQ workaround or any custom function unless many triangles have to be processed at once.
Building the Excel Formula for the Hypotenuse
For a triangle where both legs are known, drop two numbers into adjacent cells and let Excel do the rest.
- Click on cell A1 and type Leg 1. Click on cell B1 and type Leg 2. Click on cell C1 and type Hypotenuse.
- In cell A2 enter the first leg, for example 3. In cell B2 enter the second leg, for example 4.
- Click on cell C2 and type =SQRT(A2^2+B2^2).
- Press Enter. Cell C2 should show 5, because √(3² + 4²) = √(9 + 16) = √25 = 5.
- To apply the same formula to a whole list, select cell C2, grab the small square at the bottom-right corner of the cell, and drag it down through the remaining rows of legs in columns A and B.
- If the result shows too many or too few decimals, right-click the result cell, choose Format Cells, and pick a Number format with two or three decimal places.
That single line works for any pair of positive legs and updates the moment either input changes. It is essentially the formula c = √(a² + b²) tucked inside a spreadsheet cell, which is exactly what the Pythagorean theorem calls for. If a leg is entered with units such as metres, the hypotenuse inherits those units automatically.
Finding a Missing Leg with a Rearranged Formula
When the hypotenuse and one leg are already known, the same theorem is rearranged to b = √(c² − a²). In Excel the substitution is straightforward: keep the same caret and SQRT pattern, but the subtraction happens before the square root. Place the hypotenuse in one cell and the known leg in another, then type =SQRT(A2^2-B2^2) into a free cell. Because the hypotenuse is always the longest side, c² − a² must come out positive; if it does not, Excel returns the #NUM! error, which is the spreadsheet's way of saying no such right triangle exists. A built-in check, like flagging impossible inputs, is one area where a spreadsheet's raw formula offers no guidance beyond the error code, so users often add a separate IF cell to validate the inputs before calculation.
Switching to a Browser-Based Calculator
Excel handles a column of triangles cleanly, but the moment the area, perimeter, and acute angles are also needed, the spreadsheet grows a column at a time. A dedicated right triangle solver avoids that bookkeeping. The Pythagorean Theorem Calculator runs the same a² + b² = c² rule inside the browser, so the two known sides are entered once and the missing side, the area (½ · a · b), the perimeter (a + b + c), and the two acute angles all appear together. Computations happen locally, nothing is uploaded, and the worked formula — for example c = √(a² + b²) — is shown next to the result so each step can be followed rather than trusted blindly. For a homework problem, a quick drafting check, or any one-off measurement, that approach is often faster than laying out cells.
How the Pythagorean Theorem Calculator Works
Three short steps cover every situation the theorem can throw at a triangle.
- Choose whether the goal is the hypotenuse (from two legs) or a missing leg (from the hypotenuse and one leg).
- Type the two lengths already known into the two input boxes on screen.
- Read the missing side instantly, along with the area, perimeter, and both acute angles, all updated live as the inputs change.
Because the hypotenuse is always the longest side, the calculator rejects cases where the entered hypotenuse would be shorter than one of the legs; that is the same logic as the Excel #NUM! error, but flagged with a plain-language note. Numbers are rounded to a readable number of decimal places while keeping enough precision for exact Pythagorean triples — 3-4-5, 5-12-13, 8-15-17 — to come out whole, which is a reliable way to confirm the tool is behaving.
What the Calculator Reports Beyond the Missing Side
As soon as all three sides are known, the calculator fills in the rest of the triangle automatically. The area is given by ½ · a · b, since the two legs double as the base and the perpendicular height. The perimeter is just a + b + c, the sum of the three sides. Both acute angles are worked out with the arctangent and always add to 90°, which is a built-in sanity check: if they do not, the underlying triangle is not right-angled and the theorem does not apply. Every figure updates the moment a value is typed, so different inputs can be tried quickly without clearing cells or retyping formulas. That makes the tool a useful right triangle solver for homework, drafting, and everyday measuring rather than just a single-purpose hypotenuse finder.
Common Pythagorean Triples Worth Memorising
Some side combinations satisfy a² + b² = c² exactly with no rounding at all, and these are called Pythagorean triples. Spotting them in a result is a quick way to know the formula is behaving, and they show up constantly in textbooks and on-site construction.
| Triple (a, b, c) | Verification | Where it shows up |
|---|---|---|
| 3, 4, 5 | 9 + 16 = 25 | The classic right angle; builders mark it with tape measures |
| 5, 12, 13 | 25 + 144 = 169 | Common in school problems and survey work |
| 8, 15, 17 | 64 + 225 = 289 | Used in carpentry and roof framing |
| 7, 24, 25 | 49 + 576 = 625 | Appears in navigation and physics problems |
| 9, 40, 41 | 81 + 1600 = 1681 | Less common but still exact |
Any whole-number multiple of a triple is also a right triangle. Doubling 3-4-5 gives 6-8-10, and tripling it gives 9-12-15, all of which satisfy a² + b² = c² exactly. In Excel those combinations are a free way to check that a new formula behaves correctly, and in the calculator they should display with the third side coming out as a clean integer rather than a long decimal. Real-world uses for the theorem stretch well beyond geometry: builders square up walls, surveyors turn north-south and east-west distances into a straight-line distance, and the distance formula used in coordinate geometry and game development is just the Pythagorean theorem written in x and y. Even a TV screen size measured along the diagonal is the hypotenuse of the rectangle formed by its width and height.