Skip to content

Pythagorean Theorem Calculator

Written by Dr. Andrew Chen Dr. Andrew Chen, PhD in Computer Science
Reviewed by Prof. Omar Farooq Prof. Omar Farooq, PhD in Mechanical Engineering

Last updated 2026-08-18 · 8 cited sources

The Pythagorean theorem states that in a right triangle the two shorter sides, squared and added, equal the longest side squared: a² + b² = c². That longest side is the hypotenuse, and it always lies opposite the right angle. Euclid proves it as Proposition 47 of Book I of the Elements, and proves the reverse — that a triangle whose sides satisfy the equation must contain a right angle — as Proposition 48.

You need two of the three sides, and you need to know which is which. Choose "Find hypotenuse" and type both legs, or choose "Find a leg" and type the known leg first and the hypotenuse second. The panel returns the missing side, the arithmetic that produced it, the finished triangle with its area and perimeter, and both acute angles.

Two limits matter before you start. The triangle must contain a right angle, so an oblique one is out of scope, and the calculator carries no units — both entries have to be in the same one. Sides round to four decimal places, angles to one.

Pythagorean Theorem Calculator

Enter your values below.

Missing Side

Enter your details and press “Calculate” to see your results.

The theorem: in a right triangle, the legs' squares sum to the hypotenuse's square — a² + b² = c². Solving forward gives c = √(a² + b²); solving for a leg rearranges to √(c² − b²), with the calculator enforcing the geometry (the hypotenuse must be the longest side). The full triangle comes along: area (half the legs' product), perimeter, and both acute angles via arctangent — everything a homework problem or a framing square asks.

What Is the Pythagorean Theorem?

It is a statement about areas before it is a statement about lengths, and that is the version which makes the rest of the page obvious rather than memorized.

Two right triangles turn up so often that their side ratios are worth memorizing rather than computing, starting with the isosceles case in the 45-45-90 Triangle Calculator.

The Statement, in Words and in Symbols

Build a square outward on each of the three sides of a right triangle. The square standing on the hypotenuse has exactly the same area as the other two squares put together. Write the legs as a and b and the hypotenuse as c, and that sentence becomes a² + b² = c². Wolfram MathWorld describes it as "this most fundamental of all geometric theorems", and the smallest whole-number case shows why the area reading is the honest one.

a² + b² = c²

3-4-5 triangle
   square on the first leg    3² = 9
   square on the second leg   4² = 16
   9 + 16                     = 25
   square on the hypotenuse   5² = 25

Nothing in the statement mentions size, orientation, or units. A triangle with legs of 3 and 4 inches, 3 and 4 meters, or 3 and 4 miles is the same triangle scaled, and the equation holds in each case — which is why the calculator asks only for numbers and hands the units back to you unchanged.

The relationship also runs in reverse, and the reverse direction is the one that squares up buildings.

Legs, Hypotenuse, and Why c Is Always the Longest

MathWorld sets the vocabulary: the largest side is conventionally written c and called the hypotenuse, while the other two are the legs, sometimes the catheti. You identify the hypotenuse by position rather than by measuring, since it is the one side facing the right angle.

Its length is forced by the equation. Since a² and b² are both positive, c² is strictly larger than either of them on its own, so c is strictly longer than either leg. A right triangle with a "hypotenuse" equal to or shorter than one of its legs does not exist, and no amount of arithmetic will produce one.

That is the geometry behind the refusal you get in leg mode when the two entries arrive in the wrong order: "The hypotenuse must be the longest side — enter leg first, then hypotenuse". Entering 12 and 11 returns that message rather than a number, and so does entering 10 and 10.

The Converse: What Makes a Corner Square

Elements I.48 runs the theorem backward: if the square on one side of a triangle equals the sum of the squares on the other two, then the angle contained by those two sides is right. Nobody has to measure the angle. Measure three lengths, do the arithmetic, and the angle is settled — which is the whole basis of the 3-4-5 check used to square a foundation, a deck frame, or a tile layout.

The comparison keeps working when the equation fails, and Euclid states both failure cases too. Elements II.12 says the square on the side opposite an obtuse angle is greater than the sum of the squares on the other two; II.13 says the square opposite an acute angle is less. So the sign of the difference classifies the triangle:

Three sidesa² + b²Largest angle
3, 4, 52525Right — exactly 90°
3, 4, 4.52520.25Acute — under 90°
3, 4, 62536Obtuse — over 90°
6, 8, 10100100Right
6, 8, 11100121Obtuse
5, 12, 12169144Acute
8, 15, 16289256Acute
20, 21, 29841841Right

This calculator does not run that test. It assumes the right angle is there and works from two sides, so it will happily treat a badly measured corner as square and return a confident number. The test above is three squarings and a comparison; do it by hand whenever the right angle is the thing in doubt.

Euclid, Garfield, and 367 Proofs

Elements I.47 carries what MathWorld calls "perhaps the most famous proof of all times": drop a perpendicular from the right angle to the hypotenuse, continue it across the square built on that side, and each of the two rectangles it creates turns out to have exactly the area of the square on the leg beside it. It is more than 2,000 years old, and the perpendicular is what does the work — it turns a claim about two totals into a match between individual pieces.

The supply never dried up. Cut The Knot, citing Elisha Scott Loomis's The Pythagorean Proposition — reprinted by the National Council of Teachers of Mathematics in 1968 — puts the collection in that book at 367 separate proofs. One of them is by James Garfield, who in 1876 published a proof built on a trapezoid while serving in the House of Representatives, five years before becoming president.

None of that history changes the arithmetic below, but it explains why this one equation gets its own calculator while most formulas share a page.

How Do You Calculate the Pythagorean Theorem?

Three arithmetic steps going forward, three going back, and the calculator shows you both so the working can be checked rather than trusted.

The Pythagorean Theorem Formula, Both Directions

One equation, rearranged twice. To find the hypotenuse you add the squares of the legs and take the square root; to find a missing leg you subtract the known leg's square from the hypotenuse's square and take the square root of what is left. The calculator also derives the rest of the triangle from whichever two sides it ends up with.

Hypotenuse from two legs     c = √(a² + b²)
Missing leg from the rest    a = √(c² − b²)

Area          (leg × leg) ÷ 2
Perimeter     leg + leg + hypotenuse
Acute angles  arctan(leg ÷ other leg), then 90° minus that

The second line is the first line with b² taken off both sides. It is why the order of entry matters in leg mode: c² − b² has to stay positive, and it only does so when the hypotenuse is the larger of the two numbers you typed.

The area line uses the two legs and never the hypotenuse, because in a right triangle the legs are already a base and a height at right angles to each other. MathWorld gives the same expression for a right triangle's area.

How to Calculate It by Hand

Four steps, in this order, with legs of 3 and 4 as the running example:

  • Identify the hypotenuse. It is the side facing the right angle, and it is the longest of the three.
  • Square the two sides you know. 3 × 3 = 9 and 4 × 4 = 16.
  • Add them if you are after the hypotenuse, subtract if you are after a leg. 9 + 16 = 25.
  • Take the square root. √25 = 5, so the hypotenuse is 5.

Going the other way is the same routine with one sign changed. Given a hypotenuse of 10 and a leg of 6: 10 × 10 = 100, 6 × 6 = 36, 100 − 36 = 64, and √64 = 8.

Squaring first and rooting last is not optional. √(3² + 4²) is 5, but 3 + 4 is 7, and the two are not close — the theorem adds areas, not lengths, and the square root at the end is what converts the area back into a length.

Step by Step With This Calculator

Three fields and two buttons, in reading order:

  • Solve For — a two-button switch. "Find hypotenuse (know both legs)" is selected when the page loads; "Find a leg (know leg + hypotenuse)" is the other setting.
  • First Known Side — a leg in either mode. In leg mode this is the leg you already measured, not the hypotenuse.
  • Second Known Side — the other leg in hypotenuse mode, or the hypotenuse itself in leg mode.
  • Calculate runs the formula. Reset empties both boxes and returns the panel to its opening state.

The page opens with a dash in the readout rather than a worked example, because both side boxes start blank. Nothing is computed until you press Calculate, and nothing recalculates while you type — change a value and press the button again to see the new answer.

Both side boxes are number fields that accept decimals, so 7.5 and 0.75 are as valid as 7 and 75. Blank, zero and negative entries are all refused with the same message, "Enter both known sides", so the calculator never returns an answer for a triangle that cannot exist.

Worked Example: Legs of 3 and 4

Leave the switch on "Find hypotenuse", type 3 in the first box and 4 in the second, and press Calculate. The hand working and the panel agree line for line.

First leg squared     3² = 9
Second leg squared    4² = 16
Sum                   9 + 16 = 25
Hypotenuse            √25 = 5
Area                  (3 × 4) ÷ 2 = 6
Perimeter             3 + 4 + 5 = 12
First acute angle     arctan(3 ÷ 4) = 36.9°
Second acute angle    90° − 36.9° = 53.1°
What the result panel returns
5 | c = √(3² + 4²) = √25 | Right triangle: legs 3 and 4, hypotenuse 5 · area 6 · perimeter 12 | Acute angles: 36.9° and 53.1° — and 3-4-5 style triples make it exact

Nothing here is rounded. The sum of the squares is itself a perfect square, so the hypotenuse is the whole number 5, and the area and perimeter come out as 6 and 12 with no decimals attached. That exactness is rare — it happens only for the triples listed further down this page.

Scale the same triangle and the shape is untouched: legs of 6 and 8 return 10, legs of 30 and 40 return 50, and both keep the angles at 36.9° and 53.1°.

Worked Example: A Leg From the Hypotenuse

Switch to "Find a leg (know leg + hypotenuse)", type the known leg of 6 first and the hypotenuse of 10 second, then press Calculate.

Hypotenuse squared    10² = 100
Known leg squared     6² = 36
Difference            100 − 36 = 64
Missing leg           √64 = 8
Area                  (6 × 8) ÷ 2 = 24
Perimeter             6 + 8 + 10 = 24
Acute angles          arctan(6 ÷ 8) = 36.9°, and 53.1°
What the result panel returns in leg mode
8 | missing leg = √(10² − 6²) = √64 | Right triangle: legs 6 and 8, hypotenuse 10 · area 24 · perimeter 24 | Acute angles: 36.9° and 53.1° — and 3-4-5 style triples make it exact

Reverse the two entries — 10 first, 6 second — and no answer appears at all. The tool reads the second box as the hypotenuse, finds it smaller than the first, and returns the amber notice instead of a negative number under a square root sign.

A few more leg-mode runs, each returning a whole number: leg 20 with hypotenuse 25 gives 15, leg 8 with hypotenuse 17 gives 15, leg 40 with hypotenuse 41 gives 9, and leg 60 with hypotenuse 61 gives 11.

When the Answer Is Not a Whole Number

Most pairs of sides do not produce a tidy result. Legs of 1 and 1 return 1.4142, which is √2 rounded to four decimals — an irrational number with no exact decimal form at any length. The panel's second line keeps the exact version, printing "c = √(1² + 1²) = √2", so the value you need for an algebra answer sits next to the value you need for a tape measure.

That second line is also where a surd gets simplified. Pull the largest square factor out of the number under the root and the exact form drops out:

Legs enteredPanel's second lineExact formReadout
1 and 1√2√21.4142
3 and 3√183√24.2426
2 and 4√202√54.4721
2 and 6√402√106.3246
4 and 8√804√58.9443
5 and 10√1255√511.1803
6 and 12√1806√513.4164

Four of those rows have legs in a 1-to-2 ratio — 2 and 4, 4 and 8, 5 and 10, 6 and 12 — which is why √20, √80, √125 and √180 all reduce to a multiple of √5. Check any line by multiplying out: 6 × √5 is 13.4164, the same figure the readout gives for legs of 6 and 12.

Pythagorean Theorem Examples From Real Measurements

Every example below is a right triangle wearing a job title. The measurements go in as plain numbers and come back the same way, so the unit is whatever you were already working in.

A Ladder Against a Wall

The ladder is the hypotenuse, the distance from the wall to its feet is one leg, and the height it reaches is the other. Take a 20-foot ladder with its feet 5 feet out from the wall: switch to leg mode, enter 5 then 20, and the readout gives 19.3649 feet of reach above the line "missing leg = √(20² − 5²) = √375".

A 24-foot ladder set 6 feet out reaches 23.2379 feet. Both runs report the same pair of acute angles, 14.5° and 75.5°, because 6 out of 24 is the same ratio as 5 out of 20 — the second ladder is the first one scaled by 1.2, and scaling never changes an angle.

Reach is not the same as usable height. The figure the calculator returns is where the top of the ladder touches the wall, and the last few rungs of any ladder are not standing room.

Television and Monitor Diagonals

A screen size is a hypotenuse. The "55-inch" on the box is the corner-to-corner diagonal of the panel, and the width and height that actually have to fit your wall are the two legs.

For a 16:9 screen the sides are in the ratio 16 to 9, so a diagonal d satisfies d² = (16k)² + (9k)² = 337k². Rearranged, each side of the panel is a fixed fraction of the number on the box:

16:9 screen, diagonal d
   width  = d × 16 ÷ √337 = d × 0.8716
   height = d × 9  ÷ √337 = d × 0.4903
   √337 = 18.3576
Advertised sizeWidth (in)Height (in)Diagonal the tool returns
24-inch20.9211.7724.0037
27-inch23.5313.2426.9992
32-inch27.8915.6932.0004
43-inch37.4821.0843.0014
50-inch43.5824.5149.9996
55-inch47.9426.9655.0008
65-inch56.6531.8764.9994
75-inch65.3736.7775.0018
85-inch74.0841.6784.9955

Each diagonal lands a few thousandths off its label only because the widths and heights above are rounded to two decimals. Every row also returns the same acute angles, 60.6° and 29.4°, since all 16:9 panels are one shape at different sizes.

For ratios other than 16:9 — a 21:9 ultrawide monitor, or the 4:3 of an older display — work the width and height out first with the Aspect Ratio Calculator.

One number the table cannot give you is the bezel. Manufacturers quote the panel diagonal, and the cabinet around it adds width and height that no formula predicts — measure the product listing, not the marketing figure, before cutting a recess.

Rafters, Stair Stringers and Room Diagonals

Rise and run are legs; the sloping piece of timber laid across them is a hypotenuse. Each row below is one run of this calculator in hypotenuse mode.

What is being measuredTwo known sidesResult
One stair tread and riser7.5 in rise, 10 in run12.5 in of stringer
A 14-step flight105 in rise, 140 in run175 in of stringer
A steeper 14-step flight105 in rise, 132 in run168.6683 in
A rafter on a 6-in-12 roof6 ft rise, 12 ft run13.4164 ft
Diagonal of a 12 × 16 room12 ft and 16 ft20 ft
Diagonal of a 10 × 14 deck10 ft and 14 ft17.2047 ft
Guy wire, pole top to anchor30 ft pole, 12 ft out32.311 ft

Two of those rows are triples in disguise. A 7.5-inch rise on a 10-inch run is a 3-4-5 triangle multiplied by 2.5, which is why the stringer length comes out at exactly 12.5, and the 105-by-140 flight is the same shape multiplied by 35, giving exactly 175. Both runs also report the 3-4-5 angles, 36.9° and 53.1°.

Timber lengths need more than the hypotenuse. A rafter wants its overhang and its birdsmouth cut added or subtracted, and a stringer's usable length depends on how it meets the floor — the calculator gives the geometric line between two points, which is the starting figure and not the cut list.

The Distance Between Two Points

MathWorld puts it plainly: in the plane, the distance between two points is given by the Pythagorean theorem. The horizontal gap is one leg, the vertical gap is the other, and the straight-line distance is the hypotenuse. Going from (2, 3) to (10, 9) means 8 across and 6 up, so entering 8 and 6 returns 10.

Negative coordinates make no difference once the gaps are taken, because a gap is a distance and never negative. From (−3, −1) to (4, 5) the horizontal gap is 7 and the vertical gap is 6, and entering those returns 9.2195 — the decimal form of √85.

Note that this calculator has no coordinate boxes: subtract the pairs yourself and enter the two differences. To type four coordinates straight in, or to work between latitude and longitude instead, use the Distance Calculator.

That subtraction is what makes the theorem the backbone of coordinate geometry. Distance, the length of a vector, and the radius in the equation of a circle are all this one calculation with different names on it.

A Box Diagonal Takes Two Runs

The longest object that fits inside a rectangular room or crate runs corner to opposite corner in three dimensions, and this calculator handles two at a time. Do it in two passes: first the floor diagonal from length and width, then that answer against the height.

Room 12 × 16 × 8
   pass 1   legs 12 and 16   →  20
   pass 2   legs 20 and 8    →  21.5407

The second pass is legitimate because the floor diagonal and the vertical edge meet at a right angle, so the pair forms its own right triangle standing on that diagonal. Feed 20 and 8 into the tool and the readout is 21.5407, above the line "c = √(20² + 8²) = √464".

Some boxes come out exact. A 3 × 4 × 12 crate gives 5 on the first pass and then 13 on the second, both whole numbers, because 3-4-5 and 5-12-13 are both triples and they chain.

Pythagorean Theorem Chart: Triples and Common Results

A Pythagorean triple is three whole numbers that satisfy the equation exactly, so the square root at the end lands on an integer instead of a decimal. MathWorld records the smallest and best known as 3, 4, 5.

Every Primitive Triple With a Hypotenuse Under 100

Primitive means the three numbers share no common factor, so the triple is not merely a larger copy of a smaller one. Sixteen of them have a hypotenuse of 100 or less, and every figure below comes from running that triple through this calculator with the shorter leg entered first.

TripleAcute anglesAreaPerimeter
3, 4, 536.9° and 53.1°612
5, 12, 1322.6° and 67.4°3030
7, 24, 2516.3° and 73.7°8456
8, 15, 1728.1° and 61.9°6040
9, 40, 4112.7° and 77.3°18090
11, 60, 6110.4° and 79.6°330132
12, 35, 3718.9° and 71.1°21084
13, 84, 858.8° and 81.2°546182
16, 63, 6514.3° and 75.7°504144
20, 21, 2943.6° and 46.4°21070
28, 45, 5331.9° and 58.1°630126
33, 56, 6530.5° and 59.5°924154
36, 77, 8525.1° and 64.9°1386198
39, 80, 8926.0° and 64.0°1560208
48, 55, 7341.1° and 48.9°1320176
65, 72, 9742.1° and 47.9°2340234

The list hides a rule worth knowing. MathWorld notes that in every Pythagorean triple one side is divisible by 3, another by 4, and another by 5 — sometimes a single side covers two of those, as in 8-15-17, 7-24-25 and 20-21-29, and in 11-60-61 the side 60 covers all three. It follows that the product of the two legs is always divisible by 12 and the product of all three sides by 60, which is a quick way to reject a mistyped "triple" before trusting it. One further pattern is easy to miss: in two triples the area and the perimeter come out as the same number, and a short rearrangement shows why there cannot be a third.

Area equal to perimeter
   (a × b) ÷ 2 = a + b + c    with c = √(a² + b²)
   rearranges to (a − 4)(b − 4) = 8
   8 = 1 × 8 or 2 × 4, so a − 4 is 1, 2, 4 or 8

One row in the table has its area and its perimeter equal: 5-12-13 gives 30 and 30. Only one other right triangle with whole-number sides does the same, and it is 6-8-10 — the doubled 3-4-5, not primitive, so not listed above — which gives 24 and 24. The algebra shows why there is no third: four factor pairs exist, and they produce those same two triangles twice over.

Scaling a Triple: the 3-4-5 Family

Multiply every side of a triple by the same number and the result is still a triple. The 3-4-5 family is the one that reaches building sites:

Legs enteredHypotenuseAreaPerimeter
0.75 and 11.250.3753
3 and 45612
6 and 8102424
9 and 12155436
12 and 16209648
15 and 202515060
30 and 4050600120
300 and 400500600001200

Every row returns the same two angles, 36.9° and 53.1°, because scaling changes the size of a triangle and not its shape. The other two columns scale differently, and the table shows it: tripling the sides multiplies the perimeter by 3, from 12 to 36, but the area by 9, from 6 to 54. Multiply the sides by 100 and the perimeter goes from 12 to 1200 while the area goes from 6 to 60,000.

For squaring a corner, the larger member of the family is the better tool. Marking 3 feet along one edge and 4 along the other puts a quarter-inch error into a 5-foot diagonal; marking 6 and 8 and checking for 10 spreads the same quarter inch over twice the distance, so it represents half the angular error.

Where Triples Come From: Two Whole Numbers

Triples are not found by trial and error. MathWorld records the Greek construction: take two whole numbers m and n with m the larger, sharing no common factor, one of them even and the other odd, and the three expressions below are always a primitive triple.

Pick m > n, coprime, opposite parity
   first side    m² − n²
   second side   2 × m × n
   hypotenuse    m² + n²
mnm² − n²2mnm² + n²Triple
213453, 4, 5
32512135, 12, 13
41158178, 15, 17
43724257, 24, 25
5221202920, 21, 29
54940419, 40, 41
6135123712, 35, 37
6511606111, 60, 61
7245285328, 45, 53

Watch the third and fourth columns rather than assuming an order. With m = 4 and n = 1 the expression m² − n² gives 15 while 2mn gives 8, so the smaller leg is the second one — the construction produces both legs but does not sort them. Either order gives the same hypotenuse in the calculator; only the order of the two reported angles changes.

Every triple in the previous table can be produced this way, and the construction never runs out, which is the short answer to whether the list of triples ends. It does not.

Hypotenuses That Are Square Roots

Away from the triples, the answer is a decimal that never terminates. These are the pairs that turn up most often in homework, with the exact value alongside the readout:

LegsUnder the rootExactReadout
1 and 1√2√21.4142
1 and 2√5√52.2361
2 and 2√82√22.8284
1 and 3√10√103.1623
2 and 3√13√133.6056
3 and 3√183√24.2426
1 and 4√17√174.1231
5 and 5√505√27.0711
10 and 10√20010√214.1421

Five of those rows have equal legs, and they all follow one pattern: when a = b the equation collapses to c = a√2, so the hypotenuse is the leg times 1.41421. Legs of 5 return 7.0711 and legs of 10 return 14.1421 — each one is its leg multiplied by √2, then rounded to four places.

That is the 45-45-90 triangle, and its second fixed cousin — a short leg, a long leg of short × √3, and a hypotenuse of exactly twice the short leg — is worked out on the 30-60-90 Triangle Calculator.

The 30-60-90 shape can be checked here too. Put the tool in leg mode, enter a short leg of 1 and a hypotenuse of 2, and it returns 1.7321 with angles of 30.0° and 60.0° — √3 to four decimals.

How to Read Your Result

One large readout and three breakdown rows, in the same order on every run. Each row is split at its first colon or equals sign, with the words on the left becoming a label and everything after it the value.

The Four Lines the Panel Returns

For legs of 3 and 4, the panel carries exactly this, top to bottom:

  • 5 — the missing side, on its own, in the large readout. This is the number you came for.
  • c = √(3² + 4²) = √25 — the arithmetic, with your own figures substituted in and the exact value under the root preserved.
  • Right triangle: legs 3 and 4, hypotenuse 5 · area 6 · perimeter 12 — all three sides restated in order, then the two quantities that follow from them.
  • Acute angles: 36.9° and 53.1° — and 3-4-5 style triples make it exact — the two non-right angles, which always add to 90°.

In leg mode the second line changes shape, reading "missing leg = √(10² − 6²) = √64" rather than starting with c, and the third line lists the leg you entered before the one the tool worked out. Everything else keeps its position. A "Copy result" button sits inside the panel below the three rows and appears only once a calculation has succeeded; it copies the readout and the rows as text, with each row's label joined to its value rather than separated as it is on screen.

The closing phrase on the fourth line is fixed text that appears on every calculation. It is a remark about triples in general, not a verdict on the numbers you typed, so seeing it does not mean your triangle is one.

Which Angle Belongs to Which Side

The two angles are printed in a fixed order: the first is the angle opposite the side you typed into the first box. Enter 48 and then 27 and the line reads "Acute angles: 60.6° and 29.4°"; enter the same triangle as 27 and then 48 and it reads "Acute angles: 29.4° and 60.6°". The triangle is identical, the hypotenuse is 55.0727 either way, and only the reading order has moved.

Leg mode follows the same rule using the leg you supplied. A leg of 12 against a hypotenuse of 13 gives "Acute angles: 67.4° and 22.6°", the larger angle first because 12 is the longer of the two legs; the same triangle built forward from legs of 5 and 12 gives "22.6° and 67.4°".

Both numbers carry one decimal place, and the second is worked out as 90 minus the first, so the pair on screen adds back to 90.0. The angle opposite the longer leg is always the larger of the two, which is the quickest way to tell which is which without re-reading your entries.

Rounding: Four Decimals on Sides, One on Angles

Sides, area and perimeter are rounded to four decimal places with trailing zeros dropped, which is why a hypotenuse of 5 prints as "5" and not "5.0000", while legs of 1 and 1 give "1.4142". Angles always carry one decimal, so a half-square triangle reports "45.0°" rather than "45°".

The value under the root sign is rounded as well, and at ordinary sizes that is invisible. It shows up only on very small numbers: legs of 0.004 and 0.005 return a correct hypotenuse of 0.0064, but the line above it reads "c = √(0.004² + 0.005²) = √0", because the true sum of 0.000041 rounds away at four decimal places.

The fix is to work in a smaller unit. A 3-4-5 triangle entered in meters as 3 and 4 returns 5 above "√25"; the same triangle entered in millimeters as 3000 and 4000 returns 5000 above "√25000000", and every intermediate figure stays readable.

The Two Messages That Replace an Answer

When a calculation cannot proceed, an amber "Check your inputs" notice appears in place of the readout, carrying one of two sentences:

  • "Enter both known sides" — one of the boxes is blank, or holds zero, a negative number, or something the field cannot read as a number.
  • "The hypotenuse must be the longest side — enter leg first, then hypotenuse" — leg mode, where the second entry is not larger than the first. Equal values trigger it too, since a triangle whose leg matches its hypotenuse has no third side.

Neither message reports a fault. The first refuses a triangle with a side of zero or less, and the second refuses one whose sides contradict the theorem, both of which would otherwise end in the square root of a negative number.

The cure for the second message is nearly always the order of entry rather than the measurements. Put the shorter figure in the first box, the longer in the second, and press Calculate again.

Limits: When This Calculator Does Not Apply

The theorem is narrow by design, and so is the tool built on it. These are the situations where it gives you nothing, or gives you something you should not use:

  • No right angle, no theorem. An oblique triangle needs the law of cosines, c² = a² + b² − 2ab·cos C, which reduces to a² + b² = c² only when C is 90° and its cosine is zero. Euclid states the two failure cases geometrically in Elements II.12 and II.13.
  • The right angle is assumed, never checked. Enter two sides of a corner that is three degrees out of square and you still get a confident hypotenuse. Verify the corner with the converse test before trusting the number.
  • Flat surfaces only. Distances across a curved surface — a great-circle route between two cities, for instance — are not hypotenuses, and this calculation will understate them.
  • Two sides, or nothing. There is no way to enter an angle and one side; that is trigonometry rather than this theorem, and it needs a sine or a cosine instead of a square root.
  • No units and no unit conversion. Both boxes take bare numbers, so entering 6 feet and 30 inches produces a meaningless answer. Convert to a common unit first.
  • One triangle per run. A three-dimensional diagonal, a chain of rafters, or a polygon perimeter each need several passes, with the intermediate answers carried forward by hand.
  • Precision runs out below about a hundredth of a unit, as the rounding section above shows. Values that small are better re-entered in a smaller unit.
  • The arithmetic runs in your browser, but the page around it carries analytics and advertising scripts like any other page on the web — the calculation is local, the visit is not.

When the angles are the known quantity rather than the sides, the two standard triangles have their own pages, starting with the 30-60-90 Triangle Calculator.

Inside those limits it is exact and unarguable, which is rarer than it sounds. Given two sides of a genuine right triangle there is one possible third side, one area, one perimeter and one pair of angles, with no assumption, average or estimate anywhere in the chain.

Frequently Asked Questions

What is the Pythagorean theorem formula?

a² + b² = c², where a and b are the legs of a right triangle and c is the hypotenuse opposite the right angle. Rearranged for the hypotenuse it is c = √(a² + b²); rearranged for a missing leg it is a = √(c² − b²). Legs of 3 and 4 give c = √(9 + 16) = √25 = 5.

How do you find the hypotenuse?

Square both legs, add the results, then take the square root. Entering 3 and 4 returns 5 above the line "c = √(3² + 4²) = √25", along with an area of 6, a perimeter of 12 and angles of 36.9° and 53.1°. The hypotenuse is always the longest of the three sides, so an answer shorter than a leg means the inputs were swapped.

How do you find a missing leg?

Subtract the known leg's square from the hypotenuse's square and take the square root: leg = √(c² − b²). Switch to "Find a leg", enter the known leg of 6 first and the hypotenuse of 10 second, and the panel returns 8 above "missing leg = √(10² − 6²) = √64". Entering 10 first returns an error instead, because the second box is read as the hypotenuse.

What is the 3-4-5 rule?

It is the converse of the theorem used as a squaring tool. Measure 3 units along one edge and 4 along the other; if the diagonal between the marks is exactly 5, the corner is a true 90°. Multiples work identically and more accurately over distance — 6-8-10, 9-12-15, 12-16-20 and 15-20-25 all check the same right angle across a longer span.

What are all the Pythagorean triples under 100?

Sixteen primitive triples have a hypotenuse of 100 or less: 3-4-5, 5-12-13, 7-24-25, 8-15-17, 9-40-41, 11-60-61, 12-35-37, 13-84-85, 16-63-65, 20-21-29, 28-45-53, 33-56-65, 36-77-85, 39-80-89, 48-55-73 and 65-72-97. Every other triple in that range is a multiple of one of them, such as 6-8-10 or 30-40-50.

Does the Pythagorean theorem work on non-right triangles?

No — it holds only when one angle is exactly 90°. Any other triangle needs the law of cosines: c² = a² + b² − 2ab·cos C. The comparison still tells you something, though: sides of 3, 4 and 6 give 25 against 36, so the largest angle is obtuse, while 3, 4 and 4.5 give 25 against 20.25, so all three angles are acute.

Why does my answer have four decimal places?

Because most hypotenuses are irrational and have no exact decimal form. Legs of 1 and 1 return 1.4142, which is √2 rounded to four decimal places rather than cut short, and the panel's second line keeps the exact value by printing "c = √(1² + 1²) = √2". Every side, area and perimeter is rounded the same way and angles to one decimal, so a whole-number answer such as 5 prints with no decimals at all.

How wide is a 55-inch TV really?

About 47.94 inches wide and 26.96 inches tall for a 16:9 panel, because the 55 is the diagonal. Multiply the diagonal by 0.8716 for width and by 0.4903 for height. Typing 47.94 and 26.96 back into this calculator returns 55.0008, the small excess coming from rounding the two sides to hundredths.

How high does a 20-foot ladder reach against a wall?

With its feet 5 feet from the wall, 19.3649 feet. Use leg mode with 5 in the first box and 20 in the second, and the panel shows "missing leg = √(20² − 5²) = √375" with angles of 14.5° and 75.5°. That figure is where the ladder meets the wall, not the height you can safely stand at.

Why does the calculator say the hypotenuse must be the longest side?

Because in leg mode the second box is read as the hypotenuse, and c² − b² would be negative if it held the smaller number. Entering 12 then 11, or 10 then 10, produces that message rather than an answer. Re-enter with the leg first and the hypotenuse second.

Can I use this for a 3D diagonal?

Yes, in two passes. For a 12 × 16 × 8 room, enter 12 and 16 to get a floor diagonal of 20, then enter 20 and 8 to get 21.5407 for the corner-to-corner distance. The two-pass method works because the floor diagonal and the vertical edge meet at a right angle.

Who proved the Pythagorean theorem?

Euclid gives the classical proof as Proposition 47 of Book I of the Elements, and the converse as Proposition 48. Proofs have accumulated ever since: Elisha Scott Loomis's The Pythagorean Proposition collects 367 of them, including one published in 1876 by James Garfield, then a member of the House of Representatives and later president.

Methodology. This calculator uses standard, peer-reviewed mathematical formulas. It is reviewed and maintained by the Vast Calculators editorial team.

Last updated ·

Results are estimates for general use; verify critical figures independently.

What to Work Out Next

See all Math Calculators