Home / Math / Geometry for building
The 3-4-5 rule and squaring a corner
Use the Pythagorean theorem and the 3-4-5 rule to lay out perfectly square corners, check a frame with diagonals, and find any diagonal length.
Beginner · 10 min read · Updated December 3, 2026
A square corner is an exact 90 degree angle, also called a right angle. Decks, foundations, walls, tile layouts and fences all depend on square corners. If the first corner is off, every board, tile and sheet after it is off too. The 3-4-5 rule lets you check a corner with nothing but a tape measure.
The Pythagorean theorem
In a triangle with a right angle, the two sides that form the corner are called the legs. The long side across from the corner is the hypotenuse, or the diagonal.
The Pythagorean theorem says:
a x a + b x b = c x c
Here a and b are the legs and c is the diagonal. Written with squares, it is a² + b² = c².
The 3-4-5 rule
Try legs of 3 and 4:
- 3 x 3 = 9.
- 4 x 4 = 16.
- 9 + 16 = 25.
- 5 x 5 = 25. So the diagonal is exactly 5.
That means: if one side measures 3, the other measures 4, and the diagonal between them measures exactly 5, the corner is square.
Any multiple of 3-4-5 also works. Bigger triangles are more accurate, because a small measuring error matters less.
| Multiply by | Legs | Diagonal |
|---|---|---|
| 1 | 3 and 4 | 5 |
| 2 | 6 and 8 | 10 |
| 3 | 9 and 12 | 15 |
| 4 | 12 and 16 | 20 |
It works in any unit: feet, meters or even inches. In metric, 0.6 m, 0.8 m and 1.0 m is handy for small layouts.
How to square a corner
Set the first line
Snap a chalk line or set a string line for one side. This is your reference.Measure 6 ft along the first line
From the corner, mark 6 ft along the first line.Measure 8 ft along the second line
From the same corner, swing the tape roughly at a right angle and mark 8 ft.Measure the diagonal
Measure between the two marks. It should be exactly 10 ft.Adjust and recheck
Move the second line (not the first) until the diagonal reads 10 ft. Then remeasure all three sides.
Reading the diagonal:
- Longer than 10 ft: the corner is open, more than 90 degrees. Swing the second line in toward the first.
- Shorter than 10 ft: the corner is closed, less than 90 degrees. Swing it out.
Checking a whole rectangle
For a full rectangle, like a deck frame or a foundation form, measure both diagonals, corner to corner. If the two diagonals are equal, the rectangle is square.
Example: a 12 ft by 16 ft deck. 12-16-20 is 3-4-5 times 4, so each diagonal should be 20 ft. If one is 20 ft 1/2 in and the other is 19 ft 11 1/2 in, push the frame along the long diagonal until they match.
Finding any diagonal
When the sides are not a 3-4-5 multiple, use the theorem and a calculator's square root key √.
Example: a 10 ft by 12 ft shed floor.
- 10 x 10 = 100.
- 12 x 12 = 144.
- 100 + 144 = 244.
- √244 = 15.62 ft.
- Change the decimal to inches: 0.62 x 12 = about 7.45 inches (using the unrounded 0.6205).
- Change 0.45 inch to sixteenths: 0.45 x 16 = 7.1, so about 7/16.
- The diagonal is about 15 ft 7 7/16 in.
The same math gives a rafter or stair stringer length. A run of 12 ft and a rise of 5 ft: 144 + 25 = 169, and √169 = 13 ft exactly (a 5-12-13 triangle).
Modern tools
Construction calculator apps find diagonals in feet, inches and fractions directly. Laser measures and cross-line lasers that project a 90 degree line speed up layout, especially indoors. Still check with a tape and the 3-4-5 rule, because lasers can be knocked out of calibration.
Common mistakes
- Measuring from different points. All three measurements must start from the exact same corner point.
- Tape sag. On long diagonals, pull the tape tight or have a helper hold it level.
- Adjusting the reference line. Fix the first line in place and only move the second.
Practice
- The legs of a right triangle are 9 ft and 12 ft. How long is the diagonal?
- The legs are 5 ft and 12 ft. How long is the diagonal?
- A rectangle is 8 ft by 15 ft. What should each diagonal measure if it is square?
- A rectangle is 10 ft by 14 ft. What is the diagonal to the nearest 1/16 inch?
- You mark 6 ft and 8 ft and the diagonal reads 10 ft 1 in. Is the corner open or closed, and which way do you move the second line?
Answers
- 15 ft. 81 + 144 = 225, and √225 = 15. (3-4-5 times 3.)
- 13 ft. 25 + 144 = 169, and √169 = 13.
- 17 ft. 64 + 225 = 289, and √289 = 17.
- 17 ft 2 7/16 in. 100 + 196 = 296. √296 = 17.205 ft. 0.205 x 12 = 2.46 in. 0.46 x 16 = 7.3, so 7/16.
- Open (more than 90 degrees), because the diagonal is too long. Swing the second line in toward the first until the diagonal reads 10 ft.