Skip to main content
Bookmark this site for daily use! Press CTRL+D to save

Pythagorean Theorem Calculator - Find the Hypotenuse, a Leg, or Check a Right Triangle

Solve a² + b² = c² instantly. Find a missing hypotenuse or leg, verify whether three side lengths form a right triangle, or calculate a 3D box diagonal, all with a visual diagram and the full step-by-step formula shown.

Instant Results
Visual Diagram
100% Free
Right Triangle Check

What is the Pythagorean theorem calculator?

The Pythagorean theorem calculator solves a² + b² = c² for any right triangle. Enter two known values, legs a and b or one leg and the hypotenuse c, and it solves for the missing side, plus the triangle's angles, area, and perimeter. It also includes a separate mode to check whether any three side lengths actually form a right triangle, and a 3D mode for box and room diagonals.

Pythagorean Theorem Calculator

Enter both legs of the right triangle. The calculator solves c = √(a² + b²).

The Pythagorean Theorem, Explained the Way You Actually Use It

Quick Answer

The Pythagorean theorem says that in any right triangle, a² + b² = c², where a and b are the two shorter sides (the legs) and c is the longest side (the hypotenuse), always located opposite the 90-degree angle. Most people don't need the theory they need to find one missing length from two known ones, or confirm a corner is actually square. This calculator does both, and the rest of this page explains exactly when and how to use it correctly.

Most explanations of this formula stop at the definition and a single textbook example. That's not enough to actually use it well. In practice, the theorem shows up in three very different situations: finding a missing measurement when you already know a triangle is right-angled, checking whether a corner or layout is actually square before you build something, and working backward from a real-world object, like a screen or a ladder, into the triangle hiding inside it. Each of these has its own pitfalls, which is exactly what the sections below cover.

The three things people actually come here to do

  • Find a missing side you know two of the three sides of a right triangle and need the third, the most common use covered in the "Find Hypotenuse" and "Find a Leg" modes above
  • Check if a triangle is actually right-angled you have three measurements and need to confirm whether a corner, frame, or layout is truly square, covered by the "Check Right Triangle" mode
  • Solve a real-world version of the problem a ladder against a wall, a TV's diagonal size, a diagonal brace, or a 3D room diagonal, all of which are the same formula wearing a different costume

The Formula, Where It Comes From, and Why Squares

The Pythagorean Theorem

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-degree angle and always the longest of the three.

Why the formula uses squares, not just the sides themselves

The name "Pythagorean theorem" actually comes from a geometric picture, not an algebra trick. If you draw a square directly on each side of a right triangle, the area of the square built on the hypotenuse is exactly equal to the combined area of the two squares built on the legs. Squaring a length converts it into the area of a square with that side length, and the theorem is really a statement about those three areas being in balance. Taking a square root at the end simply converts an area back into a length, which is why solving for a missing side always ends in a square root step.

Solving for the hypotenuse: step by step

Step 1: Square each known leg

a = 3 → 3² = 9. b = 4 → 4² = 16

Step 2: Add the two squared values

9 + 16 = 25

Step 3: Take the square root

√25 = 5, so c = 5

Solving for a missing leg: step by step

Step 1: Square the hypotenuse and the known leg

c = 13 → 13² = 169. a = 5 → 5² = 25

Step 2: Subtract the known leg's square from the hypotenuse's square

169 − 25 = 144

Step 3: Take the square root

√144 = 12, so the missing leg b = 12

The one rule that trips people up most

Subtraction only goes one direction here. You always subtract a leg's square from the hypotenuse's square, never the other way around, because the hypotenuse is the largest value by definition. If your subtraction gives a negative number, you have mislabeled which side is the hypotenuse.

How to Check If a Triangle Is Actually a Right Triangle

Quick Answer

Sort your three side lengths from shortest to longest. Square the two shorter sides and add them. If that sum equals the square of the longest side, the triangle is a right triangle. This rule is called the converse of the Pythagorean theorem, and it is what carpenters, builders, and surveyors actually use far more often than solving for a missing side.

This direction of the formula is the one that gets the least attention online, despite being the most practically useful for anyone building or laying out something physical. If you already know all three measurements and just need to confirm a corner is square, you do not need to solve any equation, you only need to check whether it balances.

The 3-4-5 method, used on real job sites

This is the most common practical application of the converse. To check or create a perfectly square corner without any specialized tools: measure 3 units along one wall or edge from the corner, measure 4 units along the other wall or edge from the same corner, then measure the diagonal distance between those two points. If that diagonal measures exactly 5 units (or any multiple, like 6-8-10 or 9-12-15), the corner is square. This works because 3, 4, and 5 form a Pythagorean triple, and the units can be feet, meters, or any consistent measurement.

Common Pythagorean TripleUse Case Example
3, 4, 5Squaring a corner on a small deck or garden bed layout
6, 8, 10Same ratio, doubled, used when 3-4-5 is too small to measure accurately
9, 12, 15Same ratio, tripled, useful for larger room or foundation layouts
5, 12, 13Less common but useful when site constraints don't allow a 3-4-5 layout
8, 15, 17Occasionally used in framing and larger structural layouts

Two quick check examples

6, 8, 10 — passes the check

6² + 8² = 36 + 64 = 100, and 10² = 100. They match, so this is a right triangle.

5, 7, 9 — fails the check

5² + 7² = 25 + 49 = 74, but 9² = 81. They don't match, so this is not a right triangle.

Real-World Situations Where This Formula Actually Gets Used

These are not invented textbook problems they are the actual situations that bring most people to a Pythagorean theorem calculator in the first place.

Scenario 1: Choosing a safe ladder length

Scenario: You need a ladder to reach a gutter 12 feet up, and for safety the base of the ladder should sit 5 feet away from the wall.

Calculation: The wall height and ground distance form the two legs of a right triangle. Ladder length = √(12² + 5²) = √(144 + 25) = √169 = 13 feet.

Outcome: You know to buy or extend a 13-foot ladder, not a 12-foot one, because the ladder itself is the hypotenuse, not the wall height.

Scenario 2: Working out a TV or monitor's actual size

Scenario: A TV listing shows the screen is 24 inches wide and 13.5 inches tall, but doesn't clearly state the diagonal size shoppers usually compare.

Calculation: Diagonal = √(24² + 13.5²) = √(576 + 182.25) = √758.25 ≈ 27.5 inches.

Outcome: You can verify the advertised screen size matches the actual width and height before buying, which is a common discrepancy in resold or off-brand listings.

Scenario 3: Confirming a deck frame is square before fastening it

Scenario: You've built a rectangular deck frame and want to confirm the corners are truly 90 degrees before screwing it down permanently.

Calculation: Measure 3 feet along one side and 4 feet along the adjacent side from the same corner, then measure the diagonal between those two points. It should read exactly 5 feet.

Outcome: If the diagonal reads 5 feet exactly, the frame is square. If it's off by more than a fraction of an inch, the frame needs adjusting before you fasten anything.

Scenario 4: Finding the diagonal of a moving box or storage room

Scenario: You need to know if a long item, like a piece of pipe or a folded table, will fit diagonally inside a storage room measuring 12 by 10 by 9 feet.

Calculation: Floor diagonal = √(12² + 10²) ≈ 15.62 ft. Full 3D space diagonal = √(12² + 10² + 9²) ≈ 18.25 feet.

Outcome: You learn the absolute longest straight item that could theoretically fit is about 18.25 feet, measured corner to opposite corner through the room, not just across the floor.

A Quick Checklist Before You Trust Any Pythagorean Calculation

Run through these four checks before relying on a result for anything that matters, like a cut, a purchase, or a structural layout.

  1. 1

    Confirm there is actually a right angle

    If the triangle isn't right-angled, this formula gives a wrong answer that still looks valid. If you're unsure, use the Check Right Triangle mode first.

  2. 2

    Identify the hypotenuse correctly

    It is always the longest side and always opposite the right angle, never one of the two shorter legs. Mixing this up is the single most common error.

  3. 3

    Keep your units consistent

    Mixing feet and inches, or meters and centimeters, in the same calculation produces a meaningless result. Convert everything to one unit first.

  4. 4

    Sanity-check the answer's size

    The hypotenuse should always be larger than either leg, and a missing leg should always be smaller than the hypotenuse. If your result violates either rule, recheck which value you entered where.

Using the Pythagorean Theorem in 3D - the Space Diagonal Formula

Quick Answer

For a rectangular box or room, the longest internal diagonal is found with d = √(l² + w² + h²), where l, w, and h are the length, width, and height. This is the same theorem applied twice in sequence: once to find the floor's diagonal, then again combining that floor diagonal with the height.

Most explanations skip how this 3D version is actually derived, but understanding it makes the formula much easier to trust. First, treat the floor as a flat rectangle and find its diagonal using the standard 2D formula: floor diagonal = √(l² + w²). That floor diagonal then becomes one leg of a brand-new right triangle, with the room's height as the other leg, and the full corner-to-corner space diagonal as the new hypotenuse. Applying the theorem a second time gives d = √((floor diagonal)² + h²), which simplifies to d = √(l² + w² + h²).

Worked example

A room measuring 12 ft long, 10 ft wide, and 9 ft tall:
Floor diagonal = √(12² + 10²) = √244 ≈ 15.62 ft
Space diagonal = √(15.62² + 9²) = √(244 + 81) = √325 ≈ 18.03 ft

When the Pythagorean Theorem Does Not Apply

This formula only ever works on right triangles. For any triangle without a 90-degree angle, you need the Law of Cosines instead: c² = a² + b² − 2ab·cos(C), where C is the angle opposite side c. Notice that if angle C is exactly 90 degrees, cos(90°) equals zero, and the formula collapses back into the familiar a² + b² = c². The Pythagorean theorem is really a special case of this more general rule, which is why it only applies when you can confirm a right angle exists.

A quick way to remember the boundary

If you can see or measure a 90-degree angle in the triangle, use a² + b² = c². If you only know three side lengths and aren't sure, run the Check Right Triangle mode first before solving anything else.

A Quick Note on Where This Formula Actually Came From

The theorem carries the name of the Greek philosopher and mathematician Pythagoras, active around 570 to 495 BCE, and Greek tradition credits his school with the first general proof. But the underlying relationship was already known and used over a thousand years earlier. A Babylonian clay tablet known as Plimpton 322, dated to roughly 1800 BCE, contains columns of numbers consistent with Pythagorean triples, suggesting Babylonian scribes understood the relationship for practical surveying and construction long before Pythagoras was born. Independent versions also appear in ancient Chinese mathematical texts, such as the Zhoubi Suanjing, and in Indian Vedic mathematics. The name stuck mainly because Greek mathematics emphasized formal proof, while earlier cultures used the relationship practically without necessarily proving it in the abstract sense modern math expects.

Common Mistakes When Using the Pythagorean Theorem

Applying it to a triangle that isn't actually right-angled

The formula only works on right triangles. Using it on any other triangle gives a confident-looking but wrong answer. Always verify the right angle first, or use the converse check if you're working from three known sides.

Mislabeling the hypotenuse

The hypotenuse is always the side opposite the right angle and always the longest of the three sides. Treating a leg as the hypotenuse, especially when solving for a missing leg, produces a negative number under the square root, which is a clear sign of this exact mistake.

Mixing units mid-calculation

Entering one leg in feet and another in inches without converting first produces a meaningless result, even though the math itself runs without error. Always convert every measurement to the same unit before calculating.

Rounding too early

Rounding an intermediate square root before squaring it again in a later step, such as the 3D diagonal calculation, compounds small errors. Carry full decimal precision through every step and round only the final answer.

Forgetting the converse only checks, it doesn't measure angles directly

The converse confirms whether a² + b² equals c², which tells you a triangle is right-angled, but it does not tell you which specific angle is 90 degrees unless you already know which side is the longest. Always sort your three sides first so the comparison lines up correctly.

Frequently Asked Questions

Load Examples
Quick Reference
Hypotenusec = √(a² + b²)
Missing Legleg = √(c² − known leg²)
Right Triangle Checka² + b² = c²
Area½ × a × b
3D Diagonald = √(l² + w² + h²)
Common Pythagorean Triples
3, 4, 5Most common
6, 8, 10Double of 3-4-5
5, 12, 13Common alternate
9, 12, 15Triple of 3-4-5
8, 15, 17Less common
Calculator Features

Visual Diagram

See the triangle scale to your numbers

Right Triangle Check

Verify any three sides with the converse rule

3D Box Diagonal

Room and box space-diagonal mode

CSV Export

Download your result as a spreadsheet

Tips for Accurate Results
1

Always confirm a right angle exists before solving for a side

2

Double-check which side is the hypotenuse — it must be the longest

3

Keep every measurement in the same unit before calculating

4

Use the 3-4-5 method on site to verify square corners without a calculator

5

For non-right triangles, use the Law of Cosines instead of this formula

Fahad Ahmad, Founder of CalculatorsKit
About the Author

Fahad Ahmad

Founder of CalculatorsKit · Full-Stack JavaScript Developer · SEO & Digital Product Creator

Fahad Ahmad is the founder of CalculatorsKit and a full-stack JavaScript developer with more than 10 years of experience building modern web applications and online tools. He specializes in developing fast, accurate, and user-friendly calculators that help people make informed decisions in finance, health, education, business, mathematics, construction, and everyday life.

Every calculator published on CalculatorsKit is carefully researched, tested, and designed for accuracy and ease of use. Using modern technologies including Next.js, React, Tailwind CSS, and Shadcn UI, Fahad focuses on creating privacy-friendly tools that work instantly in the browser without requiring downloads or registration.

In addition to building calculators, Fahad writes educational articles that explain formulas, calculation methods, financial concepts, and practical examples in simple language so students, professionals, and everyday users can better understand the results they receive.

Popular Calculators