Smekys
Ad Space

Pythagorean Theorem Calculator

Free Pythagorean theorem calculator: enter any two sides to instantly solve the missing leg or hypotenuse of a right triangle with a² + b² = c².

Enter Values

units

First perpendicular leg of the right triangle. Set to 0 if this is the side you want solved.

units

Second perpendicular leg of the right triangle. Set to 0 if this is the side you want solved.

units

Longest side, opposite the right angle. Set to 0 when you know both legs and want c.

Result

Leg a
3
Leg b
4
Hypotenuse c
5
Area (half base × height)
6
Pythagorean Triple?
1

The Pythagorean theorem is the most famous relationship in geometry: in any right triangle, the square of the hypotenuse equals the sum of the squares of the two legs, or simply a² + b² = c². This calculator from Smekys solves whichever side you are missing. Enter any two known sides, leave the unknown one at 0, and the missing value appears instantly — whether it is the hypotenuse c or one of the legs a or b.

Unlike tools that only solve for the hypotenuse from two legs, this engine runs the equation in all three directions. You can check a ladder against a wall, size a TV diagonal, frame a roof, or verify a construction diagonal on a jobsite in seconds.

How to Use

  1. Identify the right angle in your problem. The two sides forming it are the legs a and b; the side opposite it is the hypotenuse c, always the longest of the three.
  2. Type your known value into Leg a.
  3. Type your other known value into Leg b.
  4. Put the third known side into Hypotenuse c only if you already know it — otherwise leave it at 0.
  5. Exactly one field should be 0: that is the side the calculator will solve. If all three are filled in, the engine treats the two legs as known and recomputes c.
  6. Read the result card: the solved side is highlighted, and you also get the triangle's area and a flag telling you whether the three lengths form a Pythagorean triple.

A quick sanity check: the hypotenuse must always be longer than either leg, and a² + b² must equal c². If your inputs violate that (for example, a leg longer than the hypotenuse), the tool flags an invalid triangle rather than returning a nonsense square root.

The Formula

For a right triangle with legs a and b and hypotenuse c:

a² + b² = c²

Three rearrangements cover every case:

  • Solve for c: c = √(a² + b²)
  • Solve for b: b = √(c² − a²)
  • Solve for a: a = √(c² − b²)

The most familiar example is the 3-4-5 triangle: 3² + 4² = 9 + 16 = 25 = 5². Scaled by any integer, it is the classic builders' 3-4-5 square: measure 3 feet along one wall, 4 feet along the other, and the diagonal between the marks is exactly 5 feet when the corner is 90 degrees.

Examples

Example 1 — Finding the hypotenuse. A laptop screen is 12 inches wide and 7 inches tall. Enter leg a = 12, leg b = 7, hypotenuse c = 0. The calculator returns c = √(144 + 49) = √193 ≈ 13.89 inches — that is the advertised diagonal screen size.

Example 2 — A ladder against a wall. A 20-foot ladder leans against a house, and the base is placed 6 feet out from the wall for safety. With hypotenuse c = 20 and leg a = 6 (the distance from the wall), the missing leg b = √(400 − 36) = √364 ≈ 19.08 feet reach up the wall. If the painter pays $1.50 per vertical foot of reach, this height is worth roughly $28.60 of usable ladder before you even set the bottom.

Example 3 — Verifying a deck corner. A contractor is laying a 24-foot by 32-foot deck. The diagonal should be √(24² + 32²) = √(576 + 1024) = √1600 = 40 feet exactly. Measuring a 40-foot diagonal across the corners confirms the frame is square; if it is off by even a few inches, one corner is not at 90 degrees.

Example 4 — Missing leg on a ramp. A handicap ramp runs from a 30-inch doorway down to ground level, and its sloped surface is 25 feet (300 inches) long. Solving for the horizontal run: leg = √(300² − 30²) = √(90,000 − 900) = √89,100 ≈ 298.5 inches of flat approach — information you need before ordering the rail material, which is priced per linear foot at about $22/ft.

FAQ

What is the Pythagorean theorem?

In any right-angled triangle, the square of the hypotenuse (the side opposite the right angle) equals the sum of the squares of the two legs: a² + b² = c². Written by Euclid around 300 BC and named for Pythagoras of Samos, it lets you find any third side from the other two.

How do I find the hypotenuse when I know both legs?

Square each leg, add them, and take the square root: c = √(a² + b²). For example, with legs 9 and 12, c = √(81 + 144) = √225 = 15. In this calculator, enter 9 and 12 in the legs and leave hypotenuse c at 0.

How do I solve for a missing leg?

If you know the hypotenuse and one leg, rearrange the formula: missing leg = √(c² − knownLeg²). Example: c = 13, known leg a = 5, so b = √(169 − 25) = √144 = 12 — the 5-12-13 triple. In the calculator, enter 5 in leg a, 13 in hypotenuse c, and leave leg b at 0.

What is a Pythagorean triple?

A set of three positive whole numbers — a, b, c — that exactly satisfies a² + b² = c² with no rounding. The simplest triples are (3, 4, 5), (5, 12, 13), (8, 15, 17), and (7, 24, 25). Any multiple of a triple, such as (6, 8, 10) or (30, 40, 50), is also a triple. This calculator flags your result if it lands on one.

Does the theorem work for units other than inches?

Yes — the formula is unit-agnostic. The sides just need to be in the same units. Mix feet and inches without converting first and the answer will be wrong. If your legs are in meters, c will be in meters; if they are in millimeters, c will be in millimeters.

What happens if the hypotenuse is shorter than a leg?

It is not a valid right triangle. The hypotenuse must be the longest side, and c² must equal a² + b². If you enter a larger number as a leg than as the hypotenuse, c² − a² goes negative and the square root is not real — the calculator flags the inputs rather than returning an error.

Can I use this for 3D distances?

Directly, no — the theorem covers two dimensions. For a 3D diagonal across a rectangular box, extend the idea: first find the floor diagonal d = √(a² + b²), then find the space diagonal √(d² + height²). Many solvers online call this the 3D Pythagorean formula.

Disclaimer

This Pythagorean theorem calculator is provided by Smekys for informational purposes only and does not constitute engineering, construction, or surveying advice. Results are computed directly from the a² + b² = c² formula using the values you enter; round lengths, mixed units, or measurement errors will affect accuracy. Always verify critical measurements — structural, safety, or permitting decisions — with qualified professionals and verified field instruments before relying on them.

Related Calculators

Disclaimer

Results are estimates for illustration only. Verify important figures independently.