LayoutMath

How to Square a Building: 3-4-5 Squaring Calculator

Calculator

Start here. Two sides and one diagonal. If the diagonal matches, the corner is square.

Try an example

Layout

What you are checking
3.658 m
ft
4.877 m
ft
ft
3.2 mm
in

Result

Measure both diagonals. When each reads 20′, the corners are square.

Diagonal that squares it
20′

Pull both diagonals. They should match each other and this number.

Enter a measured diagonal to check your layout.

LayoutPull the diagonal to prove square
12′16′20′

Wondering how to square a building? Type two sides and get the diagonal that proves the corner square. This squaring calculator doubles as a diagonal calculator for any rectangle, and scales 3-4-5 up to 6-8-10 or 9-12-15 for the longest check your foundation or deck allows. A footing ½ in out at the corner is a problem you meet again at every wall, floor and roof above it.

  • Free
  • No signup
  • Reviewed 15 October 2026
  • Estimates only

Quick answer A 12 × 16 ft rectangle is square when both diagonals measure 20 ft. For a quick corner check, mark 3 ft along one side and 4 ft along the other: the line between the marks reads 5 ft when the corner is a right angle. Any multiple works too: 6-8-10, 9-12-15 or 12-16-20.

3453 : 4 : 5makes a square corner

How it works

A rectangle's diagonal is fixed by its two sides. Lay out the length and the width, and if the corner-to-corner distance matches the calculated diagonal, the corners are right angles. The 3-4-5 check is the same theorem with sides picked to make the arithmetic easy: 3² + 4² = 5². Multiply all three by one number and it still holds, which is why the 345 square method and the 3 4 5 square rule scale from a quick corner check to a whole foundation.

The practical test is a diagonal measured against a tolerance, which is what a foundation square calculator checks. Pull both diagonals. They should match each other, and match the calculated value, to within the tolerance you set. The default is ⅛ in (3 mm) and you can change it.

Staking the four corners, pulling both diagonals and moving a corner stake until the readings agree is the whole method. Crews call the corner check the 3 4 5 triangle or the 345 triangle. This page also works as a diagonal of a rectangle calculator, so the arithmetic holds for any sides, not just 3 and 4.

One 3-4-5 check squares only one corner. It cannot catch a layout that has drifted into a parallelogram, which is why the diagonals get pulled as well. The step-by-step list below puts the two checks together.

Once the corners are square, lay out the patio with the paver calculator, the steps with the stair calculator or the rafters with the roof pitch calculator.

Formula

c=a2+b2(3k)2+(4k)2=(5k)2

a, b = the two sides, c = the diagonal, k = the base unit.

diagonal = √( side A² + side B² )
square when  measured diagonal ≈ calculated diagonal
3-4-5:       if the base unit is k, the sides are 3k, 4k and 5k
because      (3k)² + (4k)² = (5k)²

Worked examples

12 × 16 ft footing or deck

Show the working

√(12² + 16²) = √400 = 20 ft. Pull both diagonals. A measured 20 ft 1 in is 1 in long, which is outside a ⅛ in tolerance, so the layout needs to be pushed square before it is built on.

3-4-5 scaled to 4 ft

Show the working

A base unit of 4 ft gives 12, 16 and 20 ft, the same triangle as the 12 × 16 layout. A base of 3 ft gives 9, 12 and 15 ft. Use the longest one you can mark without leaving the walls, because a small tape error matters less over a long check.

Metric: base unit 1.2 m

Show the working

Mark 3.6 m along one side and 4.8 m along the other. The distance between the marks should be 6 m. The theorem does not care about the unit, so the same ratio works in millimetres, metres, feet or inches.

How to square a building, step by step

The calculator gives you the diagonal. These steps are the check on the ground, and they work for a foundation, a slab or a deck as well as a building, with nothing but a tape and string.

  1. Mark the first corner and one full side. Drive a stake at the corner and pull a string line along the first wall to its full length.
  2. Mark 3 and 4. Measure 3 ft along the string from the corner and mark it, then measure 4 ft along the second line and mark that. On a large layout use 6 and 8 ft, or 9 and 12 ft: the longer the check, the smaller the error.
  3. Read the line between the marks. It is 5 ft (10 ft or 15 ft for the longer versions) when the corner is a right angle. Longer means the corner is open past 90°, shorter means it is closed. Swing the second line until the tape reads right.
  4. Set the other sides. Measure each wall to its length and mark the far corners. Square the other corners the same way if the site allows.
  5. Pull both diagonals. Measure from corner to opposite corner, both ways. When the layout is square the two readings match each other and the number from this foundation squaring calculator.
  6. Nudge and measure again. Move one corner stake until both diagonals are inside your tolerance, then re-check the 3-4-5 corner and fix the lines or batter boards.

How to find the diagonal of a rectangle

The diagonal is the square root of the two sides squared and added, which is the whole sum behind a diagonal calculator. The first table gives it for common layouts, from a deck to a building, and it is the number that proves a rectangle square. The second is for a square, where the diagonal is just the side times 1.4142.

Diagonal of common rectangles
RectangleDiagonal
10 × 10 ft14′ 1 11/16″
10 × 12 ft15′ 7 7/16″
12 × 12 ft16′ 11 5/8″
12 × 16 ft20′
16 × 20 ft25′ 7 3/8″
20 × 24 ft31′ 2 7/8″
24 × 24 ft33′ 11 5/16″
24 × 32 ft40′
28 × 40 ft48′ 9 15/16″
30 × 40 ft50′
How do you find the diagonal of a square? Side by diagonal
SideDiagonal
4 ft5′ 7 7/8″
6 ft8′ 5 13/16″
8 ft11′ 3 3/4″
10 ft14′ 1 11/16″
12 ft16′ 11 5/8″
16 ft22′ 7 1/2″
20 ft28′ 3 7/16″

3-4-5 triangle sizes: 6-8-10, 9-12-15 and larger

A 3-4-5 triangle calculator only has to multiply. The 345 triangle scales up to 6-8-10, 9-12-15 and beyond, and every multiple is still a right triangle. Go as big as the layout allows: the same tape error that hides on a 5 ft check shows up plainly on a 20 ft one.

3-4-5 multiples
Base unitSides (3k · 4k · 5k)
1 ft3′ · 4′ · 5′
2 ft6′ · 8′ · 10′
3 ft9′ · 12′ · 15′
4 ft12′ · 16′ · 20′
5 ft15′ · 20′ · 25′
10 ft30′ · 40′ · 50′

Code notes

Squaring a layout is geometry, not a code section. Foundations still have to land on the dimensions in the drawings, and a deck ledger has to be square to the house if the joists are to run parallel to it.

Check both diagonals of a rectangle. Equal diagonals plus equal opposite sides is the practical field test, because a single 3-4-5 check squares only one corner. Tape sag, a crown in a batter board, and measuring to the wrong face of a form board will beat a perfect formula, so measure to the same face all the way round.

Section numbers refer to IRC 2021 section numbers; England Approved Document K. Local amendments are common, so confirm with your building authority.

FAQ

Hover a question to read the answer. Click to keep it open.Tap a question to open it.

How do you use the 3-4-5 rule to square a corner?

From the corner, measure 3 units along one side and 4 units along the other. The straight line between those marks is 5 units when the corner is square. Any multiple works: 6-8-10, 9-12-15 or 12-16-20. Go longer for accuracy, because a small tape error is a smaller angle over a longer check.

What diagonal squares a 12 by 16 rectangle?

20 feet exactly. 12-16-20 is a 3-4-5 triangle scaled by 4. If your measured diagonal is 20 feet, the layout is square to within the accuracy of the tape.

How do you find the diagonal of a rectangle?

Square each side, add the two results and take the square root: the diagonal is √(a² + b²). For a 12 by 16 ft rectangle that is √(144 + 256) = √400 = 20 ft. Type the two sides into the calculator and it returns the diagonal in feet and inches or in metres.

How do you find the diagonal of a square?

Multiply the side by √2, about 1.4142. A 10 ft square has a diagonal of 14′ 1 11/16″. It is the same formula with both sides equal, so enter the same number for both sides in the calculator.

How close is close enough?

The default tolerance here is ⅛ inch (3 mm). Tape sag grows with distance, so many crews allow a little more on a long diagonal than a short one. Type in the tolerance you can live with and compare it with the diagonal you measured. Check both diagonals: two matching diagonals confirm all four corners at once, while a parallelogram can have equal opposite sides and still not be square.

Can I scale 3-4-5 to any size, in feet or metres?

Yes. If the base unit is k, the sides are 3k, 4k and 5k in any unit, because the theorem does not depend on it. Pick the longest multiple that still fits on the two walls you can reach: a 12-16-20 check beats a 3-4-5 check with a short tape. Switch the header to metric and the ratio is 3 m, 4 m, 5 m, or any other base unit you type.

How do I square a foundation with a tape measure?

The 3-4-5 method needs only a tape. Mark 3 feet along one side from the corner and 4 feet along the other. Measure between the marks: it should read exactly 5 feet. If it does not, move the second mark until it does. For a bigger, more accurate layout use 6-8-10 or 9-12-15, then check that both diagonals of the finished rectangle match.

How do I square a deck to a house?

Use the house wall as one side. Mark 3 feet along the wall from the corner and 4 feet out along the deck edge, and the line between the marks should read 5 feet. Use 6, 8 and 10 feet for a more accurate check. Adjust the edge until it does, then pull both diagonals of the finished frame.