Pythagorean Theorem Calculator
Calculate the hypotenuse of a right triangle given the two legs.
What is Pythagorean Theorem Calculator?
The Pythagorean Theorem Calculator solves right triangle problems using the fundamental geometric principle that in any right triangle, the square of the hypotenuse (longest side) equals the sum of squares of the other two sides: a² + b² = c². Named after ancient Greek mathematician Pythagoras (though known to Babylonians centuries earlier), this theorem is essential for construction, navigation, physics, engineering, and computer graphics. Use this calculator to find any missing side when you know the other two: calculate the hypotenuse from two legs, find a leg when you know the hypotenuse and other leg, or verify whether three lengths form a right triangle. The calculator shows step-by-step work, handles decimal results, and can determine if your triangle is a Pythagorean triple (all whole numbers like 3-4-5). Whether you're framing a roof, calculating diagonal screen size, determining the shortest path, or solving geometry homework, this tool provides instant, accurate results with clear explanations.
How Pythagorean Theorem Calculator Works: The Formula Explained
The Pythagorean theorem states: a² + b² = c², where a and b are the legs (sides forming the right angle) and c is the hypotenuse (side opposite the right angle, always the longest). To find the hypotenuse when you know both legs: c = √(a² + b²). Example: For a triangle with legs 3 and 4: c = √(3² + 4²) = √(9 + 16) = √25 = 5. This is the famous 3-4-5 triangle used by carpenters for millennia. To find a leg when you know hypotenuse and one leg: a = √(c² - b²) or b = √(c² - a²). Example: If hypotenuse is 13 and one leg is 5: a = √(13² - 5²) = √(169 - 25) = √144 = 12. The theorem only works for right triangles — triangles with one 90° angle. For oblique triangles, you need the Law of Cosines. The calculator squares your inputs, performs the addition or subtraction, then takes the square root to give the missing side length.
Step-by-Step Guide to Using This Calculator
- Identify what you know: Determine which two sides you have measurements for. Label them clearly: the two shorter sides are legs (a and b), the longest side (opposite the right angle) is the hypotenuse (c). If you're unsure which is the hypotenuse, it's always opposite the 90° angle and always the longest side.
- Select what you want to find: Choose "Find hypotenuse (c)" if you know both legs, "Find leg (a)" if you know hypotenuse and leg b, or "Find leg (b)" if you know hypotenuse and leg a.
- Enter your known values: Input the two known side lengths. Use consistent units (all inches, all centimeters, etc.). The calculator accepts decimals — a leg of 7.5 cm is perfectly valid. For best accuracy, measure to at least one decimal place.
- Click Calculate: The calculator squares both known values, adds or subtracts them (depending on what you're solving for), then computes the square root. Results are displayed with up to 4 decimal places for precision.
- Review the steps: See the full calculation: the squared values, the sum or difference, and the square root operation. This helps you verify the math and understand the process for future problems.
- Check if it's a Pythagorean triple: If all three sides are whole numbers (like 3-4-5 or 5-12-13), the calculator identifies this. Triples are useful for quick mental verification and common in construction.
Real-World Examples
Example 1 — TV Screen Diagonal: You're buying a TV listed as 16 inches wide and 9 inches tall (16:9 aspect ratio). What's the diagonal screen size? Using a=16, b=9: c = √(16² + 9²) = √(256 + 81) = √337 = 18.36 inches. This is marketed as a "19-inch TV" (manufacturers round up). For a 55-inch TV, the diagonal is 55 inches — you can reverse-calculate: if width is 47.9 inches and height is 27 inches, √(47.9² + 27²) = √(2294 + 729) = √3023 = 55 inches.
Example 2 — Roof Rafter Length: You're building a shed roof with a 12-foot span (half-span = 6 feet) and 4-foot rise. The rafter forms the hypotenuse of a right triangle. Using a=6 (run), b=4 (rise): c = √(6² + 4²) = √(36 + 16) = √52 = 7.21 feet. Add overhang (typically 1-2 feet) for total rafter length. A carpenter would order 8-foot or 10-foot lumber and cut to length. For a steeper 6/12 pitch (6-inch rise per 12-inch run), with 6-foot run: rise = 3 feet, rafter = √(6² + 3²) = √45 = 6.71 feet.
Example 3 — Shortest Path Across a Field: You need to walk from one corner of a rectangular field (100m × 75m) to the opposite corner. Walking along the edges: 100 + 75 = 175m. Walking diagonally: c = √(100² + 75²) = √(10000 + 5625) = √15625 = 125m. You save 50 meters (28.6% shorter) by cutting diagonally. This principle applies to navigation, fiber optic cable routing, and any situation where you're minimizing distance between two points.
Example 4 — Ladder Safety Check: OSHA recommends a 4:1 ladder ratio (for every 4 feet of height, base should be 1 foot from wall). If your roof is 16 feet high, the ladder base should be 4 feet from the wall. What length ladder do you need? c = √(16² + 4²) = √(256 + 16) = √272 = 16.49 feet. You'd need at least a 17-foot ladder, but ladders should extend 3 feet above the roofline, so a 20-foot ladder is appropriate.
Common Mistakes to Avoid
- Using the theorem on non-right triangles: The Pythagorean theorem ONLY works for right triangles (triangles with one 90° angle). If your triangle has angles like 60°-60°-60° (equilateral) or 70°-50°-60°, the theorem doesn't apply — use the Law of Cosines instead. A quick check: if a² + b² ≠ c² with your measurements, it's not a right triangle.
- Confusing which side is the hypotenuse: The hypotenuse is ALWAYS the longest side and ALWAYS opposite the right angle. If you're given sides 5, 12, and 13, the hypotenuse is 13, not 12. When solving for a missing side, make sure you're using the correct formula: c = √(a² + b²) for hypotenuse, a = √(c² - b²) for a leg. Swapping these gives wrong answers.
- Forgetting to take the square root: The theorem gives you c², not c. If a=3 and b=4, then c² = 9 + 16 = 25, but c = √25 = 5, not 25. This is a common homework error — you've done the hard part correctly but miss the final step. The calculator handles this automatically, but when working manually, always remember: "c squared equals..." then "c equals the square root of..."
- Rounding too early in multi-step problems: If you calculate √52 and round to 7.2, then use 7.2 in further calculations, errors compound. Keep full precision (7.2111025...) in your calculator and round only the final answer. For construction, round to the nearest 1/8 or 1/16 inch depending on required precision.
Pro Tips for Better Results
- Memorize common Pythagorean triples: These whole-number combinations appear constantly: 3-4-5 (and multiples like 6-8-10, 9-12-15), 5-12-13, 8-15-17, 7-24-25. Carpenters use 3-4-5 to verify corners are square: measure 3 feet along one edge, 4 feet along the other, and the diagonal should be exactly 5 feet. If it's 5 feet 1 inch, the corner is out of square.
- Use the converse to verify right angles: If you have three lengths and want to know if they form a right triangle, check if a² + b² = c². For sides 9, 12, 15: 9² + 12² = 81 + 144 = 225, and 15² = 225. Since they're equal, it's a right triangle. If you're building a deck and measure sides of 8ft, 15ft, and diagonal of 17ft: 8² + 15² = 64 + 225 = 289, and 17² = 289. Perfect right angle!
- Apply to 3D problems by using the theorem twice: To find the diagonal of a rectangular box (length L, width W, height H): first find the base diagonal d = √(L² + W²), then find the space diagonal D = √(d² + H²) = √(L² + W² + H²). For a box 3×4×12: base diagonal = √(9+16) = 5, space diagonal = √(25+144) = √169 = 13. This applies to moving furniture through doorways, packaging design, and structural engineering.
- Recognize special right triangles: 45°-45°-90° triangles have sides in ratio 1:1:√2 (if legs are x, hypotenuse is x√2). 30°-60°-90° triangles have ratio 1:√3:2 (short leg x, long leg x√3, hypotenuse 2x). These appear in trigonometry and can be solved without a calculator once you memorize the ratios.
Frequently Asked Questions
Who discovered the Pythagorean theorem?
While named after Pythagoras of Samos (c. 570-495 BCE), the relationship was known centuries earlier. Babylonian tablets from 1800-1600 BCE show knowledge of Pythagorean triples. The Egyptian "rope stretchers" used 3-4-5 triangles to lay out right angles for pyramid construction around 2500 BCE. Chinese mathematicians proved the theorem independently in the Zhou Bi Suan Jing (c. 300 BCE). Pythagoras or his followers likely provided the first formal proof in Greek mathematics, which is why the theorem bears his name in Western tradition. The theorem appears as Proposition 47 in Book I of Euclid's Elements (c. 300 BCE), which contains the classic geometric proof using squares on each side.
Can the Pythagorean theorem be used for any triangle?
No — it applies ONLY to right triangles. However, there's a generalization called the Law of Cosines that works for any triangle: c² = a² + b² - 2ab·cos(C), where C is the angle opposite side c. When C = 90°, cos(90°) = 0, and the formula reduces to c² = a² + b² (the Pythagorean theorem). For a triangle with sides 5, 7, and included angle 60°: c² = 5² + 7² - 2(5)(7)·cos(60°) = 25 + 49 - 70(0.5) = 74 - 35 = 39, so c = √39 = 6.24. The Law of Cosines is essential for non-right triangle problems in surveying, navigation, and physics.
What are Pythagorean triples and why do they matter?
Pythagorean triples are sets of three positive whole numbers that satisfy a² + b² = c². Common examples: (3,4,5), (5,12,13), (8,15,17), (7,24,25), (20,21,29). These matter because: (1) They're easy to remember for quick mental calculations — a carpenter knows a 3-4-5 triangle is perfectly square. (2) They generate infinitely many more triples through multiplication — (6,8,10), (9,12,15), etc. (3) They appear in standardized test problems where whole-number answers are expected. (4) They have applications in cryptography and number theory. You can generate triples using formulas: for any integers m > n > 0, (m²-n², 2mn, m²+n²) forms a triple. With m=2, n=1: (4-1, 4, 4+1) = (3,4,5).
How is the Pythagorean theorem used in real life?
Applications span numerous fields: Construction: Ensuring walls are square, calculating rafter lengths, laying out foundations. Navigation: Finding shortest distance between two points, GPS triangulation. Surveying: Measuring land boundaries, calculating distances across obstacles. Physics: Resolving vectors into components, calculating resultant forces. Computer Graphics: Calculating distances between pixels, collision detection in games. Astronomy: Parallax measurements for stellar distances. Medicine: Ultrasound imaging, radiation therapy targeting. Sports: Optimal throwing angles, baseball diamond dimensions. The theorem is fundamental to Euclidean geometry and appears whenever distance or perpendicularity is involved.
Related Calculators
See also: Triangle Calculator, Area Calculator, Circle Area Calculator, Slope Calculator