1
90
°
90
°
2
²
5
1
90
°
90
°
2
²
5
The Pythagorean Theorem Calculator is one of the most practically valuable tools in the DIY and construction toolkit. The Pythagorean theorem — a² + b² = c² — states that in any right triangle, the sum of the squares of the two shorter sides (legs) equals the square of the longest side (hypotenuse). This ancient geometric principle underlies a remarkable number of everyday building tasks: squaring up a deck or room layout, cutting diagonal braces, finding rafter lengths, aligning fence lines, and verifying that a corner is truly square.
The most iconic application in construction is the 3-4-5 rule for squaring corners. If you measure 3 feet along one wall and 4 feet along the perpendicular wall, the diagonal between these two points must be exactly 5 feet for the corner to be a true 90°. Any deviation means your corner is out of square and must be adjusted before you proceed. Professional framers scale this up — using 6-8-10, 9-12-15, or even 30-40-50 for large structures — but the underlying math is always the Pythagorean theorem.
This calculator solves for any of the three sides: give it sides a and b, and it finds the hypotenuse c; give it the hypotenuse and one leg, and it finds the missing leg. It also calculates the two non-right angles of the triangle (the third angle is always exactly 90°), the triangle's area (useful for calculating material for triangular sections), and the perimeter (useful for calculating framing lumber or edging material quantities).
The angle outputs are particularly valuable for setting up power tools. Once you know the exact angle at each corner of your right triangle, you can set your miter saw, table saw, or circular saw bevel precisely — no guessing, no test cuts wasted. The angle at vertex A (the corner opposite side a) plus the angle at vertex B always sum to exactly 90°, confirming the right-angle structure.
Whether you're squaring up a shed foundation, cutting a notched stair tread, planning a diagonal garden path, or cutting triangular gussets for a workbench, this calculator gives you mathematically exact answers in seconds. The unit selector (feet, inches, meters, centimeters) ensures the output matches your tape measure reading format without requiring manual conversion.
When solving for c (hypotenuse): c = √(a² + b²). When solving for a: a = √(c² - b²). When solving for b: b = √(c² - a²). Angles: angle A = arcsin(a/c) × 180/π, angle B = arcsin(b/c) × 180/π. Area = 0.5 × a × b. Perimeter = a + b + c. All operations use JavaScript's Math.sqrt, Math.asin, and Math.PI.
For a valid right triangle, both legs (a and b) must be shorter than the hypotenuse (c). If c is less than either leg, the inputs represent an impossible triangle — check your measurements. The three most common Pythagorean triples in construction are 3-4-5, 5-12-13, and 8-15-17, all giving perfectly integer side lengths.
Inputs
Results
The classic 3-4-5 check: if your diagonal is exactly 5 ft, the corner is a perfect 90°. Angles are 36.87° and 53.13°.
Inputs
Results
A roof with 8 ft rise and 12 ft horizontal run needs a rafter of 14.42 ft. The rafter angle at the base is 33.69°.
It's the simplest application of the Pythagorean theorem for checking right angles. Measure 3 units along one wall from the corner and mark it. Measure 4 units along the perpendicular wall and mark it. If the diagonal between the two marks is exactly 5 units, the corner is a perfect 90°. Scale it up (6-8-10 or 9-12-15) for larger structures to get more accurate results over longer distances.
Enter the horizontal run (half the building width for a symmetrical gable) as side a, and the rise (total roof height from top plate to ridge) as side b. The hypotenuse c is your rafter length. Add extra for the overhang (eave) after the calculation.
A Pythagorean triple is a set of three positive integers (a, b, c) that satisfy a² + b² = c² exactly. Common examples: 3-4-5, 5-12-13, 8-15-17, 7-24-25. Builders love these because they eliminate decimal rounding — a 5-12-13 corner check gives a hypotenuse of exactly 13 ft with no measurement uncertainty.
No — the Pythagorean theorem only applies to right triangles (those with exactly one 90° corner). For triangles with no right angle, you need the Law of Cosines or Law of Sines. Most practical construction geometry is reducible to right triangles, however, so this calculator handles the vast majority of workshop needs.
This happens when the inputs describe an impossible triangle — for example, when the hypotenuse is shorter than one of the legs (c < a or c < b). In a valid right triangle, the hypotenuse is always the longest side. Check your measurements and ensure you're entering the longest side as c.
Results are computed with floating-point precision (approximately 15 significant digits in JavaScript). The display is rounded to 4 decimal places. For setting power tool angles, round to the nearest 0.1° — most miter saws and bevel gauges only resolve to ½° or 1° anyway. The high precision is useful for verifying layout measurements, not for tool settings.
The perimeter is the sum of all three sides (a + b + c). This tells you the total linear length of material needed to frame or edge the triangular shape — for instance, the total length of framing lumber for a triangular knee wall, or the total length of edging for a triangular garden bed.
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
DIY Tools Calculator
General DIY & Workshop Utilities
Square Footage Calculator
General DIY & Workshop Utilities
Volume Calculator (DIY)
General DIY & Workshop Utilities
Slope Calculator
General DIY & Workshop Utilities
Fraction Calculator (Construction)
General DIY & Workshop Utilities
Measurement Converter (DIY)
General DIY & Workshop Utilities