Measurements & Conversions

Squaring Calculator for Layout and Setting Out (3-4-5 Rule)

Check a building layout is square: the diagonal it should read, the largest 3-4-5 triangle to strike, and how far and which way to move a corner.

  • Answers as you type
  • Every formula cited
  • Calculated in your browser
SettingsSettings for this calculationUS
Market
Imperial · sales tax
The side you hold fixed, measured from the corner: usually the longer side, or the one set off an existing wall.

Set out from a line you trust — the face of the existing house, a boundary offset, a string between two profiles — and measure this side along it from the corner peg. Most layouts take the long side as the base, because an angular error at the corner grows along whichever side is longest.

Tools needed: Tape measure, String line and pins

The second side, running from the same corner and meant to be square to the base line.

Measured from the same corner point as the base side, to the mark at its far end. For a rectangle it is the width; for a single corner, such as a deck frame against a house, it is the length of the side that has to come off the base at a right angle.

A single diagonal across one corner, or the two diagonals of a four-cornered layout.

With one corner pegged — the first corner of a slab, a frame against a wall — measure across from the end of the base side to the end of the other side and enter it. Once all four corners are pegged, measure corner to corner both ways and enter how much longer one diagonal is than the other: that difference finds a racked layout without needing the sides to be exactly the lengths drawn.

The tape reading from the end of the base side straight across to the end of the other side.

Pull the tape between the same two marks the sides were measured to, level, and read it to the finest division you can. The page compares it with the square figure and works out the corner angle and how far the far end has to move.

Diagonal when square

30.79 ft

High confidence

The diagonal reads longer than the square figure, so the corner is open — more than 90° — and the far end of the second side has to swing towards the far end of the base line by the distance in the last row. Swing it on the tape from the corner so the side keeps its length, then read the diagonal again; two or three rounds of swinging and re-reading usually settle it.

Squaring triangle: leg along the longer side
20 ft
Squaring triangle: leg along the shorter side
15 ft
Squaring triangle: diagonal between the two marks
25 ft
Measured diagonal less the square figure
2.48 in
Angle at the corner
90.85 °
Corner out of square by
0.85 °
Move the far end of the second side by
2.94 in
Then change the inputs to see how far the answer moves.

Show calculation logic

How this was calculated

Formula source(s)

  • Euclid, Elements, Book I, Proposition 48 (D. E. Joyce's edition, Clark University): if the square on one side of a triangle equals the squares on the other two together, the angle between those two is right — which is why any multiple of 3, 4 and 5 makes a square corner — and Proposition 47, its converse, which gives the expected diagonal √(a² + b²)
  • The QUIKRETE Companies, Layout Basics for Slabs and Footers: stake out with the 3-4-5 triangular method, any multiple such as 6-8-10 or 9-12-15 giving the same result, then double-check for squareness by measuring the diagonals between opposite corners, which should be equal; batter boards set back from the work keep the lines
  • NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles, the law of cosines (4.42.5): the corner angle from its two sides and the diagonal across it, and, applied to the two halves of a parallelogram, d₁² + d₂² = 2(a² + b²) and d₁² − d₂² = 4ab·cos θ, from which the racked shift and angle follow

Inputs used

Side Along the Base Line
26 ft
Side to the Far Corner
16.5 ft
How You Are Checking
One diagonal, across the corner
Diagonal You Measured
31 ft
Difference Between the Two Diagonals
0.67 in

Intermediate steps

Squaring triangle: leg along the longer side
20 ft
Squaring triangle: leg along the shorter side
15 ft
Squaring triangle: diagonal between the two marks
25 ft
Measured diagonal less the square figure
2.48 in
Angle at the corner
90.85 °
Corner out of square by
0.85 °
Move the far end of the second side by
2.94 in
Final result30.79 ft

Confidence note: The diagonal reads longer than the square figure, so the corner is open — more than 90° — and the far end of the second side has to swing towards the far end of the base line by the distance in the last row. Swing it on the tape from the corner so the side keeps its length, then read the diagonal again; two or three rounds of swinging and re-reading usually settle it.

What this calculation does not cover

  • Every figure here is a horizontal distance. A tape laid on sloping ground reads the slope, which is longer than the plan distance, so on a falling site take the sides and the diagonals in level steps or along a level line; otherwise the diagonal disagrees with the square figure on a corner that is in fact square.
  • Take every reading with the same tape, at the same pull and from the same marks — the centre of the pin or the nail in the profile, not the edge of a peg. Two tapes, or one tape pulled differently, can disagree by more than the error being looked for.
  • The single-diagonal check assumes the two side lengths were measured from the same corner point to the same two marks the diagonal runs between. If the sides are not the lengths entered, the corner angle and the offset describe a different corner.
  • Equal diagonals prove a rectangle only together with equal opposite sides, and the two-diagonal shift assumes that the opposite sides are equal — that the shape has racked as a parallelogram rather than been pegged at four independent wrong lengths.
  • The 3-4-5 triangle shown is the largest that fits on the two sides from the corner. A bigger one is better still: if the lines can be pegged long past the corners, scale the triangle up beyond the building and mark the legs on the lines themselves, never in the air.
  • No tolerance is applied. How far out a corner may be is set by the job's specification or the tolerance standard it follows; the page reports the error and leaves the judgement to that.

Computed in your browser — nothing you enter is uploaded. Presented in US customary units and US trade terminology. Where a formula follows a published standard, that standard and its edition are cited beside it on this page; where none governs, the page says so. Local amendments override model codes — verify against the code in force where you build.

Sources checked 2026-10-05 · v1.0.0

Regulatory standards & verification citations3
  1. Euclid, Elements, Book I, Proposition 48 (D. E. Joyce's edition, Clark University): if the square on one side of a triangle equals the squares on the other two together, the angle between those two is right — which is why any multiple of 3, 4 and 5 makes a square corner — and Proposition 47, its converse, which gives the expected diagonal √(a² + b²)
  2. The QUIKRETE Companies, Layout Basics for Slabs and Footers: stake out with the 3-4-5 triangular method, any multiple such as 6-8-10 or 9-12-15 giving the same result, then double-check for squareness by measuring the diagonals between opposite corners, which should be equal; batter boards set back from the work keep the lines
  3. NIST Digital Library of Mathematical Functions, §4.42 Solution of Triangles, the law of cosines (4.42.5): the corner angle from its two sides and the diagonal across it, and, applied to the two halves of a parallelogram, d₁² + d₂² = 2(a² + b²) and d₁² − d₂² = 4ab·cos θ, from which the racked shift and angle follow
Cite this page

Your workspace

Most jobs need more than one number. Add the calculators you need next and they open right here, underneath this one — your figures stay on screen and nothing is lost to a page change.

Now that you have the number

These guides cover the work this quantity is for — the first ones run this calculator inside the section that raises the question.

How to calculate squaring for layout and setting out (3-4-5 rule) in 6 steps

  1. Side Along the Base LineThe side you hold fixed, measured from the corner: usually the longer side, or the one set off an existing wall.
  2. Side to the Far CornerThe second side, running from the same corner and meant to be square to the base line.
  3. How You Are CheckingA single diagonal across one corner, or the two diagonals of a four-cornered layout.
  4. Diagonal You MeasuredThe tape reading from the end of the base side straight across to the end of the other side.
  5. Difference Between the Two DiagonalsHow much longer one corner-to-corner reading is than the other.
  6. Diagonal when squareThe tool computes the diagonal when square from those figures and shows the formula, its sources, and a confidence rating alongside it.

Diagonal when square by side along the base line

Page defaults, not your figures above.

Side Along the Base LineDiagonal when square (ft)
20 ft25.9
30 ft34.2
40 ft43.2
50 ft52.6

Frequently asked questions

Why does a 3-4-5 triangle make a right angle?
Because 3 squared plus 4 squared is 5 squared, and a triangle whose sides keep that relationship has a right angle between the two shorter sides — Euclid proved it, and setting-out crews use it to this day. It holds for any multiple, in any unit: 6-8-10, 9-12-15, 1.5-2-2.5. Measure the short leg along one line and the long leg along the other from the corner, and move the second line until the distance between the two marks is the third number.
How big should the squaring triangle be?
As big as the job will hold. Every mark has a small error, and a bigger triangle turns the same error into a smaller angle, which then grows less by the time the line reaches the far corner. A triangle struck at three, four and five units on a long building is a poor guide to its far end; one scaled up to most of the shorter side is a good one, and one struck past the corners on lines pegged long is better still. The page gives the largest whole multiple that fits on the two sides themselves.
My diagonal reads long. Which way do I move the corner?
Towards the far end of the base line. A diagonal longer than the square figure means the corner has opened past 90°, so the far end of the second side is leaning away; swing it back on the tape from the corner — keeping that side's length — by the distance the page gives, and read again. A short diagonal means the corner has closed, and the end swings the other way.
Are equal diagonals enough to prove a rectangle is square?
Only with equal opposite sides. A parallelogram — a racked rectangle — has unequal diagonals, which is what the check catches. But a trapezium with two equal slanted sides also has equal diagonals while being no rectangle at all, so a layout with its four pegs at independently wrong lengths can pass a diagonal check. Read the four sides as well, then the diagonals.
Why is the difference between the diagonals bigger than the error at the corner?
Racking pulls the two readings apart from both ends at once. Slide the far side along the base and the diagonal running towards the slide grows by nearly as much as the other one loses, so the gap between the two tapes is roughly double the slide, trimmed by the ratio of the base to the diagonal. An 8 by 5 m (26 by 16.5 ft) base slid 10 mm (0.39 in) reads about 17 mm (0.67 in) apart corner to corner — a sharper test than any single side could give.
Should I use this page or the court diagonal page?
Use this page for a building layout — a slab, a foundation, a deck or a frame — checked from the diagonals you measure, and the Court Diagonal and Squaring Triangle Calculator for a sports court set out to its governing body's dimensions.
Preliminary estimate, not certified engineering. This tool produces an indicative quantity calculation for planning purposes only — it is not a certified structural analysis, a guaranteed material takeoff, or a substitute for building department approval. Always verify measurements on-site and have a licensed contractor or structural engineer review any load-bearing, code-sensitive, or safety-critical work before purchasing materials or starting construction. Spotted an arithmetic or standards error? Report it to contact@craftquantities.com with your inputs — a confirmed fix gets a permanent check of its own, so the same mistake cannot come back.