Squaring a Foundation: Batter Boards, Diagonals and the 3-4-5 Rule

A foundation that is out of square shows up in every course above it: walls that do not meet, sheets that do not fit and a roof that sits crooked. Squaring a foundation takes a tape, some stakes and strings, and a little arithmetic.

  • Guide
  • 9 min read
  • Reviewed 20 October 2026
  • Same code as the calculator

Quick answer Squaring a foundation means setting its corners at exactly 90°. Fix batter boards about 4 ft outside each corner, stretch strings between them, and move the strings until both diagonals are equal and opposite sides match. A 24 × 36 ft foundation has diagonals of 43′ 3 3/16″. Check any corner alone with a 3-4-5 triangle, such as 12, 16 and 20 ft.

What the frames are and why you need them

Batter boards are frames of stakes and horizontal boards set outside the corners of a building. The strings fixed to them mark the exact lines of the foundation, and the boards sit far enough out to survive the digging. When the excavator removes the corner stakes, the strings can be taken down and put back at the same marks, so the layout never has to be measured again from scratch.

The method is old but still the standard for houses, additions, sheds and decks. In the UK the same job is called setting out, and the frames are sometimes called profile boards. A laser and a layout stake can replace the strings on a big site, but for a small building, they are still the cheapest way to hold a square, level layout.

Materials

  • Stakes. 2×4 or 2×2 stakes about 24 in long, pointed at one end. A rectangle needs 12, three at each corner.
  • Boards. 1×4 or 1×6 boards at least 4 ft long, screwed to the stakes. A rectangle needs 8, two at each corner.
  • String. Strong mason's line that does not stretch.
  • Level. A water level, laser level or builder's level to set the tops of the boards. A 4 ft spirit level is not enough over the length of a building.
  • Tape, plumb bob and a pencil. A plumb bob transfers the string crossing to the ground.
  • Screws and a hammer. Screws hold better than nails when the string is under tension.

Tools for the whole job cost little. The only expensive item is a level that works over distance. Many builders rent or borrow a laser.

Step-by-step setup

  1. Mark the corners. Drive a corner stake at each corner of the building from your site plan, using a tape and the 3-4-5 check below.
  2. Place the batter boards. At each corner, drive three stakes in an L about 4 ft back from the corner stake, so the corner stands inside the L. The distance depends on the depth of the excavation and the machine. Leave room to dig.
  3. Fix the boards. Screw a board across each pair of stakes, so each corner has two boards at right angles to each other, one on each side of the building line.
  4. Level the tops. Pick a height, often a fixed distance above the planned top of the foundation wall, and set every board to it. Transfer the height with a laser or water level, not by eye.
  5. Run the strings. Stretch a string between the boards at opposite ends of each side, so it passes directly over the corner stakes. Tie it off with a few turns around a nail and pull it tight.
  6. Square the strings. Measure the diagonals and use the 3-4-5 check; move the strings along the boards until they pass.
  7. Mark the string positions. Saw a notch or drive a nail at each string position so you can retie them in the same place.
  8. Mark the corners on the ground. Drop a plumb bob from each string crossing and mark the point with a stake, paint or lime.

Why equal diagonals prove a square corner

A rectangle is square only if all four corners are right angles, and the Pythagorean theorem is what ties the diagonal to the sides. For sides a and b that meet at 90°, the diagonal is c = √(a² + b²). If a corner is a little more or less than 90°, the diagonal across it comes out shorter or longer than that figure. So you can test an angle without a square: measure the sides, compute the diagonal and compare it with the tape.

c = √(a² + b²)
a = √(c² − b²)

The test needs opposite sides to be equal. A parallelogram has equal sides but unequal diagonals, and a rectangle has equal sides and equal diagonals. If the two diagonals are equal and the opposite sides are equal, the figure is a rectangle. That is why the standard check is two measurements: both diagonals. For a single corner, use the 3-4-5 rule described below.

Squaring the strings

The strings are a rectangle in the air, and the diagonals test it. Hold a tape from one string crossing to the opposite one, then do the same on the other diagonal. For a rectangle with equal opposite sides, equal diagonals mean square corners. The diagonal comes from the Pythagorean theorem, and the table gives it for common sizes.

diagonal = √(length² + width²)
24 × 36 ft: √(288² + 432²) = 519.2 in = 43′ 3 3/16″
Plan viewBoth diagonals must read the same
24′36′43′ 3 3/16″
The diagonal a square rectangle must have
SizeDiagonal in feet and inchesIn inches
16 × 24 ft28′ 10 1/8″346.13 in
20 × 30 ft36′ 11/16″432.67 in
24 × 36 ft43′ 3 3/16″519.2 in
28 × 40 ft48′ 9 15/16″585.91 in
30 × 50 ft58′ 3 11/16″699.71 in

Check each side length first, since the diagonals only prove squareness when opposite sides are equal. If the diagonals differ, shift one string along its boards, nudge it by half the difference, and measure again. Moving one string crossing sideways by a distance s changes the diagonal through it by about s × (the side it moves along ÷ the diagonal). On a 24 × 36 ft layout, a quarter inch of difference in the diagonals is cured by sliding that crossing about 0.3 in along the long side, or 0.45 in along the short side.

A 3-4-5 check at the corner

You can also check one corner on its own. From the string crossing, mark 12 ft along one string and 16 ft along the other, then measure between the two marks. A square corner reads exactly 20 ft. Using the biggest multiple you can fit is better, since a given tape error then causes a smaller angle error. The squaring calculator gives the three sides for any unit: with a 4 ft unit they are 144 in, 192 in and 240 in, which is 12 ft, 16 ft and 20 ft.

If the layout has more than four corners, such as an L-shaped house, square the main rectangle first and then build the extra legs from it, checking each inner corner with its own diagonal or 3-4-5 triangle.

Whole-number triangles for a quick corner check

A Pythagorean triple is a set of whole numbers that fits a² + b² = c², so the third side needs no square root. The 3-4-5 triangle is the best known, and any multiple of it, such as 6-8-10 or 12-16-20, is another. Larger triangles are more accurate for the same tape error, so scale up as far as the site allows.

Triples and a size that suits a building
TripleScaled for a buildingAngles
3-4-512-16-20 ft36.9° and 53.1°
5-12-1310-24-26 ft22.6° and 67.4°
8-15-178-15-17 ft28.1° and 61.9°
7-24-257-24-25 ft16.3° and 73.7°

To use one, mark the first length along one string from the corner, mark the second along the other string, and measure between the marks. If the third measurement matches, the corner is 90°. The squaring calculator gives the three sides for any unit.

What to do when the diagonals don't match

A mismatch means one or more sides are wrong, or a corner has moved. Work through it in this order.

  1. Re-measure the sides. Check each of the four sides against the plan. A side that is long or short is the cause of most diagonal errors.
  2. Check the tape. Pull it to the same tension each time, keep it level, and read from the same points. A sagging tape reads long.
  3. Find the long diagonal. The corner at the end of the long diagonal is the one to move inward, or the corners at the ends of the short diagonal are the ones to move outward.
  4. Move a crossing along its boards, by the shift worked out above, then re-measure both diagonals and all four sides.
  5. Repeat until the diagonals agree within the tolerance you set, and check the 3-4-5 triangle at one corner to confirm.

A common goal is diagonals within 1/8 to 1/4 in on a house-sized layout, which is a tolerance the builder sets rather than one the IRC specifies. On a poured foundation, the same method tells you whether a wall is out of square before you frame on it. If the error is large, ask the builder or an engineer before adjusting the framing to hide it.

Doing the sum in feet and inches

Convert feet and inches to one unit before squaring. For a layout 12 ft 6 in by 16 ft 3 in, that is 150 in by 195 in, and the diagonal is √(150² + 195²) = 246.02 in, or 20′ 6″. Do the whole sum in inches and convert once, at the end, and read the answer to the nearest 1/16 in. A tape cannot be read finer than that over 40 ft, so chasing a smaller difference is wasted effort.

The same method for decks, slabs and sheds

Anything that has to be rectangular uses the same check. A deck frame, a slab form, a shed floor, a patio and a fence corner all take the two-diagonal test, and a ledger board against a house takes the 3-4-5 test off the wall. For a deck, check the frame before you lay boards, since a deck that is out of square makes every board end land in a different place. For a slab, check the forms before the pour, because a slab cannot be moved afterward.

For a long, narrow building, scale the 3-4-5 triangle up so the long leg runs most of the length, since the error in the angle from a tape misreading is smaller over a long leg than a short one.

Transferring the lines to the ground

Hold the plumb bob so its point is directly under the string crossing, wait for it to stop swinging, and mark the spot. If it is windy, shield the bob or lower it into a bucket of water to damp it. Then snap or spray the foundation lines on the ground between the marks. The outer face of a foundation wall is usually the string line, but the footing is wider than the wall, so mark the footing edge a set distance outside the string.

Before you dig, take the strings down and leave the boards in place. After the excavation, put the strings back on the notches, check them against the diagonals, and drop the plumb bob again to locate the walls on the footing.

Sloping sites and elevation

The boards also give a height reference. If you level their tops to a known elevation, every depth you measure from the string is relative to the same plane. On a sloping site, the boards at the high corner sit higher off the ground than the low ones, so use longer stakes there and keep the board tops level with each other. If the slope is steep, step the boards and tie the heights to a fixed benchmark such as a stake with a known elevation.

Digging below the string gives you the depth directly: measure down from the string, subtract the height of the string above the planned finish, and you have the depth to dig.

Common mistakes

  • Boards too close. The excavator takes them out, and the layout is lost.
  • Unlevel boards. Depths measured from the strings are wrong, and the foundation steps or tilts.
  • Stretchy string. A string that sags or stretches reads long and moves the corner.
  • Squaring by eye. Without the diagonals, a layout can be out by an inch over 30 ft without looking wrong.
  • Disturbed strings. Check the diagonals again after rain, wind or digging.
  • Ignoring utilities. Call 811 before you drive stakes.

Squareness has no tolerance in the IRC. Follow your plans, and aim for 1/8 to 1/4 inch on diagonals at this scale.

About the numbers

This guide is geometry and trade practice. No code section sets a squareness tolerance, so follow your plans. The diagonal table is computed by the same code as the squaring calculator.

FAQ

How far from the corner should batter boards be?

Far enough to survive the digging, commonly 3 to 4 feet outside the building line. Allow more for deep excavation or large machines.

How many boards do I need for a rectangular building?

Eight boards on twelve stakes, with two boards at right angles at each corner, is the usual arrangement.

How do I square the strings?

Measure both diagonals between the string crossings. If opposite sides are equal and the diagonals are equal, the corners are square. Use a 3-4-5 triangle to check a single corner.

Do the boards have to be level?

Yes. Level boards give you a reference height for depths, and unlevel ones make every measurement off the string wrong.

What is the diagonal of a 24 × 36 ft foundation?

43′ 3 3/16″, from √(24² + 36²).

Can I use a laser instead of strings and boards?

A laser can set heights and lines, but strings on boards give a visible rectangle that survives re-checking. Many builders use both.

What is the 3-4-5 rule?

A way to make or test a right angle with a tape. Mark 3 units along one line and 4 along the other; if the distance between the marks is exactly 5, the corner is 90°. Any multiple works, such as 12-16-20.

How do I check if a foundation is square?

Measure the four sides, then both diagonals. If opposite sides are equal and the diagonals are equal, the foundation is square. Compare the diagonal with √(a² + b²).

How close do the diagonals have to be?

The IRC sets no number. Builders commonly aim for 1/8 to 1/4 inch on a house-sized layout.

What is a plumb bob used for?

To transfer the string crossing straight down to the ground, so you can mark the corner exactly under it.

How does diagonal measurement prove a corner is square?

In a rectangle both diagonals are equal. If your two measurements differ, a corner is out of square, and moving the string at the long diagonal's end corrects it.