Pythagorean Theorem Calculator
Calculate any side of a right triangle using the Pythagorean theorem. Find rafter lengths, check square corners, and solve stair stringer geometry with full construction reference tables.
Enter your values above to see the results.
Tips & Notes
- ✓Use the 3-4-5 triple to square any corner on site. Measure 3 ft on one wall, 4 ft on the other, and check the diagonal — it must be exactly 5 ft. Scale to 6-8-10 or 9-12-15 for larger areas.
- ✓To check if a rectangle (room, slab form, deck frame) is square: measure both diagonals. If they are equal, the rectangle is square — the Pythagorean theorem guarantees this.
- ✓Memorize the rafter factors for common pitches: 6/12 = 1.118, 8/12 = 1.202, 12/12 = 1.414. Multiply your horizontal run by the factor to get rafter length without a calculator.
- ✓When measuring a hypotenuse on site, always measure the horizontal distance and vertical rise separately rather than attempting to measure the diagonal directly — horizontal and vertical measurements are far more accurate on uneven terrain.
- ✓The Pythagorean theorem applies in 3D as well: the space diagonal of a box with dimensions L×W×H = √(L²+W²+H²). Use this for calculating the longest board that fits through a doorway or into a room.
Common Mistakes
- ✗Forgetting to take the square root — c² = a² + b² gives you c squared, not c. The final step of taking the square root is required and frequently omitted in mental calculations.
- ✗Applying the formula to non-right triangles — the Pythagorean theorem is valid only when one angle is exactly 90°. For oblique triangles, use the Law of Cosines instead.
- ✗Measuring rise and run incorrectly for stair stringers — rise is the vertical height from floor to floor, and run is the horizontal distance. Mixing up which dimension is which produces a completely wrong stringer length.
- ✗Not accounting for the thickness of treads when calculating stair geometry — the actual step height (rise) is measured from tread surface to tread surface, not from the top of one riser to the bottom of the next.
- ✗Assuming the diagonal of a room equals the distance you can run a long board through — the actual clearance depends on ceiling height as well as floor dimensions, requiring the 3D space diagonal formula.
Pythagorean Theorem Calculator Overview
The Pythagorean theorem is the most applied formula in construction — it appears in every diagonal measurement, every squaring check, every rafter calculation, and every stair stringer layout. Whenever two perpendicular distances are known and the straight-line distance between their endpoints is needed (or vice versa), the Pythagorean theorem provides the answer instantly.
The theorem:
a² + b² = c² — where c is the hypotenuse (longest side, opposite the 90° angle)Solving for each unknown:
Find hypotenuse: c = √(a² + b²) | Find leg: a = √(c² − b²)
EX: Stair stringer — total rise 8.5 ft, total run 11 ft → stringer length = √(8.5² + 11²) = √(72.25 + 121) = √193.25 = 13.9 ft
EX: Squaring a room — measure diagonals. If 24×16 ft room: diagonal = √(576+256) = √832 = 28.84 ft. Both diagonals must equal 28.84 ft. If they differ, the room is not square.Common Pythagorean triples used daily in construction:
| Triple (a, b, c) | Scaled Example | Application | Angle at c |
|---|---|---|---|
| 3, 4, 5 | 6, 8, 10 ft | Squaring corners and foundations | 90° exactly |
| 5, 12, 13 | 10, 24, 26 ft | Roof layout, longer diagonal checks | 90° exactly |
| 8, 15, 17 | 16, 30, 34 ft | Stair stringers, ramp layouts | 90° exactly |
| 7, 24, 25 | 14, 48, 50 ft | Large foundation squaring | 90° exactly |
| 20, 21, 29 | 40, 42, 58 ft | Large commercial layouts | 90° exactly |
| Roof Pitch | Rise per 12" Run | Rafter Factor (per ft of run) | 10 ft Run → Rafter Length |
|---|---|---|---|
| 3/12 | 3" | 1.031 | 10.31 ft |
| 4/12 | 4" | 1.054 | 10.54 ft |
| 5/12 | 5" | 1.083 | 10.83 ft |
| 6/12 | 6" | 1.118 | 11.18 ft |
| 7/12 | 7" | 1.158 | 11.58 ft |
| 8/12 | 8" | 1.202 | 12.02 ft |
| 10/12 | 10" | 1.302 | 13.02 ft |
| 12/12 | 12" | 1.414 | 14.14 ft |
Frequently Asked Questions
Measure 3 ft along one wall from the corner and mark it. Measure 4 ft along the perpendicular wall and mark it. The diagonal between these two marks must be exactly 5 ft for a perfect 90° angle. For a full foundation, also check both diagonals across the entire rectangle — they must be equal. A 40×60 ft foundation has a diagonal of √(1600+3600) = √5200 = 72.11 ft. If both diagonals match, the foundation is square.
The run equals half the building span (for a symmetric gable roof). The rise equals the run multiplied by the pitch fraction. Example: 28-ft wide building, 6/12 pitch. Run = 14 ft. Rise = 14 × (6/12) = 7 ft. Rafter length = √(14² + 7²) = √(196 + 49) = √245 = 15.65 ft. Add overhang separately. For a 2-ft overhang: total rafter = 15.65 + 2.24 ft (overhang diagonal at same pitch) = 17.89 ft.
The essential ones are 3-4-5 (most common for squaring), 5-12-13 (useful for checking longer spans and roof layouts), and 8-15-17 (stair stringers). All multiples work: 6-8-10, 9-12-15, 12-16-20 are all 3-4-5 scaled. A quick on-site check: if the three side lengths satisfy a²+b²=c², the triangle is a perfect right angle. These eliminate the need for a square or protractor on most layout tasks.
A staircase forms a right triangle with total rise (vertical height, floor to floor) as one leg, total run (horizontal distance the staircase travels) as the other leg, and the stringer length as the hypotenuse. For a staircase with 9 ft total rise and 12 ft total run: stringer = √(81+144) = √225 = 15 ft. The individual step geometry (rise per step, run per step) is determined separately based on the number of steps.
Yes. For a 2D floor diagonal: √(length² + width²). For a 15×20 ft room: √(225+400) = √625 = 25 ft. For the 3D space diagonal (longest possible measurement inside the room, floor corner to opposite ceiling corner): √(length² + width² + height²). For 15×20×9 ft: √(225+400+81) = √706 = 26.57 ft — the maximum length board that could fit in the room diagonally.
A rectangle has four 90° angles by definition. The two diagonals of any rectangle are always equal in length — this is a geometric property. If you measure the diagonals of your framing and they differ, at least one corner is not 90°. The diagonal length = √(width² + length²). If diagonals are equal but the shape is not a rectangle (it could be a parallelogram), check that all four sides are the correct length as well.