Framing calculator
Square-Up Calculator
This square up calculator checks that a rectangle is truly square before you pour concrete or nail off a deck, so you catch a crooked layout while it is still cheap to fix. Enter the length and width and it gives the exact diagonal both corners should measure, the 3-4-5 triangle to check a single corner with a tape, and, if you enter your measured diagonals, how far out of square the layout is and which way to push it.
- Free to use
- No sign-up
- Formula and sources shown

Got the number? Save it before it gets lost.
A result on a screen is easy to lose. Save this estimate in the app and it stays with the project, ready when you order.
One side of the rectangle, as laid out on the ground.
The perpendicular side of the rectangle.
The diagonal you measured corner to corner on site. Enter both diagonals to get the out-of-square verdict.
The other diagonal, corner to corner. Both must match the calculated diagonal for the layout to be square.
Diagonal. Both corners must measure this
36.06 ft
36 ft 0-11/16 in · area 600 sq ft · perimeter 100 ft
3-4-5 check, side A
20.00 ft
3-4-5 check, side B
26.67 ft
3-4-5 check, diagonal
33.33 ft
3-4-5 unit
6.67 ft
Mark 20.00 ft down one side and 26.67 ft down the other from a corner: the distance between the marks must be 33.33 ft for a 90° corner. Measure both diagonals on site. One diagonal alone does not prove square.
Turn this result into a priced plan
Save it to a project, add the rest of your materials, and send a client-ready quote. No retyping, no spreadsheet, no lost numbers.
Formula
Diagonal = √(length² + width²); 3-4-5 check: unit = short side ÷ 3, check = short side, 4 × unit, 5 × unit; square when both diagonals match within 1/4 in
Worked example. A 20 ft by 30 ft foundation (the calculator's defaults): the diagonal is √(400 + 900) = 36.06 ft, or 36 ft 0-11/16 in. Both diagonals must measure that. The 3-4-5 check on the short side is 20 ft, 26.67 ft and 33.33 ft. If the measured diagonals are 36.06 ft and 36.10 ft, they differ by 0.48 in and the layout is out of square.
A 20 ft by 30 ft foundation is square when both diagonals measure 36.06 ft, 36 ft 0-11/16 in, and not before. That single number is the whole job of this page: the diagonal is the hypotenuse of the right triangle the two sides make, and a rectangle whose diagonals match is a rectangle whose corners are 90°. This page gives you that diagonal, the 3-4-5 triangle to check one corner with a tape, and the verdict on the diagonals you actually measured, including which way to push the layout when they disagree.
Key takeaways
- •Diagonal = √(length² + width²). A 20 ft by 30 ft rectangle has a 36.06 ft diagonal; a 12 ft by 16 ft rectangle has exactly 20 ft.
- •Both diagonals must match the calculated diagonal. One diagonal alone does not prove square. A parallelogram can share a diagonal.
- •The 3-4-5 rule: 3 units down one side, 4 down the other, 5 across the diagonal means a 90° corner. Any multiple works: 6-8-10, 9-12-15, 12-16-20.
- •Scale the 3-4-5 check to the short side: unit = short side ÷ 3. For a 20 ft short side the check is 20 ft, 26.67 ft and 33.33 ft.
- •Working tolerance is about 1/4 in on the diagonal for residential work. If the diagonals differ by more than that, adjust before you pour or nail off.
- •If the diagonals differ, push the two corners on the longer diagonal toward each other until both match, keeping the side lengths the same.
- •Use the largest 3-4-5 multiple that fits. A 1/4 in error on a 3 ft check is a big angle; on a 30 ft check it is negligible.
- •Measure with a tape held taut and level. A sagging or sloping tape gives a wrong diagonal even when the layout is square.
How to use the square-up calculator
- Enter the length and width of the rectangle in feet, as laid out on the ground, the two sides that meet at the corner you care about.
- Read the exact diagonal, in decimal feet and in feet and inches to the nearest 1/16 in. That is the number both diagonals must measure.
- Read the 3-4-5 check for the short side. It gives you three numbers to check a single corner with a tape, without measuring the full diagonal.
- Measure both diagonals on site, corner to corner, with the tape taut and level. Enter them to get the out-of-square error and the advice on which way to push.
- If the diagonals differ, shift a corner stake; push the two corners on the longer diagonal toward each other, until both diagonals match the calculated length.
- Re-measure the sides after any adjustment. The diagonals can only match if the opposite sides are equal, and pushing a corner can change a side length.
- When both diagonals match within 1/4 in, brace the layout before you pour concrete or nail off the deck. An unbraced layout moves while you work.
Worked examples
1. The default: 20 ft by 30 ft foundation
- Diagonal: √(20² + 30²) = √1300 = 36.06 ft, or 36 ft 0-11/16 in
- Both diagonals must measure 36.06 ft. Measure both, not one
- 3-4-5 check: the short side is 20 ft, so the unit is 20 ÷ 3 = 6.67 ft
- The check is 20.0 ft on one side, 26.67 ft on the other, and 33.33 ft diagonally
- Area: 600 sq ft; perimeter: 100 ft
- If the measured diagonals are 36.06 ft and 36.10 ft, they differ by 0.48 in. Out of square, push the corners on the longer diagonal together
2. The clean one: 12 ft by 16 ft deck
- Diagonal: √(12² + 16²) = √400 = exactly 20 ft
- This is a 3-4-5 triangle times 4: 12-16-20
- 3-4-5 check on the short side is 12 ft, 16 ft and 20 ft, the same triangle
- Area: 192 sq ft; perimeter: 56 ft
- If one diagonal is 20 ft 0 in and the other is 20 ft 1 in, the deck is racked 1 in. Shift a corner until the long one shrinks by half the difference and the short one grows by half
3. A small square: 4 ft by 4 ft, and a 3 ft by 4 ft corner
- A 4 ft by 4 ft square has a diagonal of 4 × √2 = 5.66 ft. The diagonal of any square is the side times 1.414
- A 3 ft by 4 ft rectangle has a diagonal of exactly 5 ft, the 3-4-5 triple itself
- For a single corner, mark 3 ft down one side and 4 ft down the other: the distance between the marks must be 5 ft
- On a large foundation, scale up: 9-12-15 or 12-16-20 is more accurate than 3-4-5, because the same 1/4 in tape error is a smaller angle on a long leg
- Never assume a 'square' foundation is square. Measure the sides independently, because a 4.00 ft by 3.97 ft layout is more common than a true 4 ft square
The diagonal table: common rectangles
Most residential layouts repeat the same few rectangles, and their diagonals are worth knowing by heart, or at least worth checking against the calculator before you trust a tape. The table below covers the sizes that come up most: small decks, standard foundations, and the clean 3-4-5 multiples that give exact diagonals. An exact diagonal is a gift on site: if the tape reads 20 ft 0 in on a 12 by 16 deck, the layout is square, and if it reads 20 ft 1 in, it is not, no arithmetic required.
| Rectangle | Diagonal | Feet and inches | 3-4-5 check |
|---|---|---|---|
| 3 × 4 ft | 5.00 ft | 5 ft 0 in | 3, 4, 5 ft |
| 4 × 4 ft (square) | 5.66 ft | 5 ft 7-15/16 in | Side × 1.414 |
| 8 × 10 ft | 12.81 ft | 12 ft 9-11/16 in | 8, 10.67, 13.33 ft |
| 10 × 12 ft | 15.62 ft | 15 ft 7-7/16 in | 10, 13.33, 16.67 ft |
| 12 × 16 ft | 20.00 ft | 20 ft 0 in | 12, 16, 20 ft |
| 16 × 20 ft | 25.61 ft | 25 ft 7-5/16 in | 16, 21.33, 26.67 ft |
| 20 × 30 ft | 36.06 ft | 36 ft 0-11/16 in | 20, 26.67, 33.33 ft |
| 24 × 32 ft | 40.00 ft | 40 ft 0 in | 24, 32, 40 ft |
| 30 × 40 ft | 50.00 ft | 50 ft 0 in | 30, 40, 50 ft |
Diagonals are √(length² + width²). The exact diagonals, 5, 20, 40 and 50 ft, are 3-4-5 multiples and are the easiest to verify on site.
The exact diagonals are the ones to remember, because they need no calculator and no fraction: 3 by 4 is 5 ft, 12 by 16 is 20 ft, 24 by 32 is 40 ft, and 30 by 40 is 50 ft. When a layout can be chosen to land on one of these, a deck at 12 by 16 instead of 12 by 15, for instance, the squaring check becomes a single tape reading, and the crew can check it without stopping work. When the layout cannot be a clean multiple, the calculator's feet-and-inches figure is the target, and the nearest 1/16 in is close enough: a 1/16 in error on a 36 ft diagonal is an angle error of about 0.01°, which no structure will notice.
Area and perimeter come free with the diagonal, and they are useful for the next step: the area sizes the concrete or the decking, and the perimeter sizes the formwork or the rim joists. A 20 by 30 foundation is 600 sq ft with a 100 ft perimeter; a 12 by 16 deck is 192 sq ft with a 56 ft perimeter. The calculator shows both so the squaring check and the material count come from the same two measurements.
The 3-4-5 method, and why bigger is better
The 3-4-5 method is the oldest squaring trick on a job site, and it is just the Pythagorean theorem with the smallest whole numbers that satisfy it: 3² + 4² = 9 + 16 = 25 = 5². Mark 3 units from a corner along one side, 4 units from the same corner along the other side, and the distance between those two marks must be exactly 5 units when the corner is a perfect 90°. It needs no calculator, no diagonal measurement across the whole layout, and no second person. One tape, two marks, one reading.
| Scale | Mark on side A | Mark on side B | Target diagonal | Best for |
|---|---|---|---|---|
| ×1 | 3 ft | 4 ft | 5 ft | Small corners, tile and cabinet work |
| ×2 | 6 ft | 8 ft | 10 ft | Small rooms and sheds |
| ×3 | 9 ft | 12 ft | 15 ft | Garages and small decks |
| ×4 | 12 ft | 16 ft | 20 ft | Decks and additions |
| ×5 | 15 ft | 20 ft | 25 ft | Large decks and foundations |
| ×10 | 30 ft | 40 ft | 50 ft | Large foundations, when the space allows |
Any multiple of 3-4-5 works. Use the largest multiple that fits inside the layout. The error shrinks as the triangle grows.
The reason bigger is better is error. A tape reading has an error of roughly 1/8 in whatever the distance, and on a 3 ft mark that 1/8 in is an angle error of about 0.6°, enough to rack a foundation visibly over 30 ft. On a 30 ft mark the same 1/8 in is an angle error of about 0.06°, ten times smaller. The rule is simple: use the largest triangle that fits inside the layout. Marking 3 ft and 4 ft to square a 40 ft wall is dangerous; marking 30 ft and 40 ft to square the same wall is the right tool. The calculator scales the check to the short side automatically, so the 3-4-5 numbers it gives are already the largest ones that fit the rectangle.
The other scaled triples are worth knowing for the same reason. The 5-12-13 triangle is useful when the layout is long and narrow, and the 8-15-17 triangle covers the cases 3-4-5 does not reach cleanly. But 3-4-5 and its multiples cover almost every residential layout, and the calculator's scaled check is the one to use: it is derived from the actual short side, so it always fits, and it is always the largest check the rectangle allows.
Reading the measured diagonals
The calculator's most useful feature is the one most rivals lack: enter the two diagonals you actually measured, and it tells you how far out of square the layout is and which way to push it. The logic is simple. In a rectangle the diagonals are equal, and the longer diagonal points to the pair of corners that are too wide, more than 90°. Push those two corners toward each other, and the long diagonal shrinks while the short one grows, until both match the calculated diagonal.
| Measured diagonals (20 × 30 ft) | Difference | Verdict | What to do |
|---|---|---|---|
| 36.06 ft and 36.06 ft | 0 in | Square | Brace it and build |
| 36.06 ft and 36.08 ft | 0.25 in | Square (within tolerance) | Brace it and build. 1/4 in is the working tolerance |
| 36.06 ft and 36.10 ft | 0.48 in | Out of square | Push the corners on the 36.10 ft diagonal together |
| 36.00 ft and 36.12 ft | 1.44 in | Out of square | Push the long-diagonal corners together; re-check the sides |
| 35.50 ft and 36.50 ft | 12 in | Badly out of square | Re-lay the whole rectangle. A side length is probably wrong |
Target diagonal for 20 × 30 ft is 36.06 ft. The advice assumes the side lengths are correct; if a side is wrong, fix the side first.
The adjustment itself is half the difference. If the diagonals differ by 1 in, moving one corner by half an inch, or each of the two long-diagonal corners by a quarter inch, brings them together, in theory. In practice, move a little less than the theory says, re-measure, and repeat: soil moves, stakes flex, and a layout that is pushed too far in one go overshoots. Two small adjustments beat one large one, and the final check is always a fresh measurement of both diagonals, not a calculation of where they should be.
One caution: if the diagonals differ by a foot or more, the problem is probably not squareness. It is a side length. A 20 by 30 layout that measures 35.50 ft on one diagonal and 36.50 ft on the other has a side wrong by inches, and no amount of pushing corners will fix it without changing a side. Re-measure the four sides first: opposite sides must be equal before the diagonals can be. The calculator assumes the sides are right, and its advice is only valid when they are.
Common square-up mistakes
- •Checking only one diagonal. A parallelogram can share a diagonal with a rectangle. Both diagonals must match, and the opposite sides must be equal.
- •Mixing inside and outside measurements. Hooking the tape on the outside of one wall and measuring to the inside face of the other gives a diagonal that is wrong by the wall thickness.
- •Using a small 3-4-5 triangle on a large layout. A 1/8 in error on a 3 ft mark is a big angle; scale up to the largest multiple that fits.
- •Measuring with a sagging or sloping tape. Hold the tape taut and level. A sagging tape reads long, and a sloping tape reads the slope distance, not the horizontal.
- •Assuming a 'square' foundation is square. Measure the sides independently: a 4.00 ft by 3.97 ft layout is more common than a true square, and squaring to the wrong sides gives the wrong diagonal.
- •Adjusting by the full difference instead of half. Move a corner by half the diagonal difference, re-measure, and repeat. One large push overshoots.
- •Forgetting to brace after squaring. An unbraced layout moves while you pour concrete or nail off the deck, and the squaring work is lost.
- •Squaring to the forms instead of the layout. If the formwork is racked, the concrete follows the forms. Square the stakes and strings first, then set the forms to them.
How this calculator compares with the rivals
The square-up search has several good tools, and the best of them already give the diagonal to the nearest 1/16 in, so this page wins on the diagnosis, not on the diagonal alone. The gap is the combination: the exact diagonal, the scaled 3-4-5 check, and the measured-diagonal verdict that tells the reader how far out of square they are and which way to push.
| Rival | What it offers | Where this page beats it |
|---|---|---|
| CalculatorWebsite | Foundation Square-Up Calculator | Diagonal and a scaled 3-4-5 check from length and width, with tape-accuracy guidance | Good on the 3-4-5 scaling. This page adds the measured-diagonal verdict and the adjustment advice. |
| DraftToolbox | Foundation Square-Up Calculator | Diagonal in architectural and fractional-inch formats from feet-and-inches sides, with a calculation log | Good on the feet-and-inches input. This page adds the 3-4-5 check table and the out-of-square diagnosis. |
| Chippy Tools. Check Square Calculator | Diagonal from length and width, with the racked-rectangle explanation and the 3-4-5 multiples | The clearest rival on why one diagonal is not enough. This page adds the measured-diagonal input and the push direction. |
| Calcady | 3-4-5 Squaring & Diagonal Calculator | Diagonal to the nearest 1/16 in, with scaled multipliers and real-world scenarios | Good on the scaled multipliers and the scenarios. This page adds the measured-diagonal verdict and the common-rectangles table. |
| CalcMaple | Squaring Calculator | Exact diagonal and the error on measured diagonals, with a common-rectangles table | The closest rival to this page, with the measured-diagonal error. This page adds the 3-4-5 check and the adjustment method. |
| CalculatorSoup | No square-up calculator in the top results for this keyword | Its strength is general-purpose calculators. |
| Home Depot / Lowe's | No square-up calculator in the top results | This page answers it and links to the quantities. |
| BuildCova's own deck calculator | Deck framing and board counts | The sibling page, not a rival. A deck that is not square is a deck that does not fit; this page squares the layout the deck page counts. |
| BuildCova's own excavation calculator | Dig volumes for footings and trenches | Related, not rival. A square foundation still needs a dug footing; the excavation page sizes the dig. |
Rival coverage is qualitative, from the top search results for this keyword. No search volumes or authority scores are claimed.
The honest summary: CalcMaple and Chippy Tools are the rivals to watch, because one already diagnoses measured diagonals and the other already explains why one diagonal is not enough. No rival combines the exact diagonal, the scaled 3-4-5 check, the common-rectangles table and the measured-diagonal verdict with push direction in one place. This page wins by being the only one that takes a reader from two side measurements to a braced, square layout.
Related tools and next steps
Squaring is the first step, not the last: once the layout is square, the next numbers are the concrete in the footings, the framing on top, and the deck or the slab that follows. Do the squaring first, every later measurement inherits its error, and then count the job.
Count the deck on the squared layout with the deck calculator, size the footing dig with the excavation calculator, and count the concrete for the footings with the concrete bag calculator. If the layout is an arch or a curved opening, the arch calculator sizes the curve it sits in.
Before you pour or nail off, measure both diagonals one final time, check the opposite sides are equal, and brace the layout so it cannot move while you work. A layout that was square at 9 in the morning and racked by noon is a layout that was never braced, and the concrete remembers the shape it was poured in.
Assumptions
- •The layout is a rectangle with opposite sides equal. A four-sided figure with unequal diagonals is skewed, and equal diagonals alone do not prove square. A parallelogram can share a diagonal with a rectangle, so the sides must be checked too.
- •The tolerance used here is 1/4 in on the diagonal for most residential work. Large foundations and long walls deserve a tighter check, and the layout should be re-measured after any adjustment.
- •The 3-4-5 check scales the smallest Pythagorean triple to the short side: the unit is the short side divided by 3, and the check gives the 3-unit side, the 4-unit side and the 5-unit diagonal. Bigger multiples are more accurate on large layouts.
- •Measurements are assumed to be taken on level ground with a tape held taut and level. A sagging, stretched or sloping tape gives a diagonal that looks wrong even when the layout is square.
Sources✓ Verified
- Pythagorean theorem (standard geometry). Diagonal = √(length² + width²); the 3-4-5 triple is the smallest integer solution of a² + b² = c².
- Framing and foundation layout practice. Equal diagonals plus equal opposite sides as the field test for square, with a 1/4 in working tolerance for residential work.
Formula reviewed November 2026.
Measure the two diagonals corner to corner. For a 20 ft by 30 ft foundation both should measure 36.06 ft. If they differ, push the two corners on the longer diagonal toward each other until both diagonals match, keeping the side lengths the same, then brace the layout before you pour. Check the 3-4-5 triangle on a single corner as well: 20 ft, 26.67 ft and 33.33 ft on the short side.
If one side of a triangle is 3 units and the other is 4 units, the diagonal between their ends is exactly 5 units when the corner is a perfect 90°. Any multiple works: 6-8-10, 9-12-15, 12-16-20 and 15-20-25 are all the same rule scaled up. Mark 3 units down one side from a corner, 4 units down the other, and the distance between the marks must be 5 units.
36.06 ft, or 36 ft 0-11/16 in. It is √(20² + 30²) = √1300. Both diagonals must measure that: if one is 36.06 ft and the other is 36.10 ft, the layout is 0.48 in out of square and needs adjusting before the pour.
No. A parallelogram can share a diagonal with a rectangle, so one diagonal alone does not prove anything. You need both diagonals to match each other and the calculated diagonal, and the opposite sides to be equal. Equal diagonals plus equal opposite sides mean the layout is square.
For most residential work, within about 1/4 in on the diagonal. A 1/4 in error on a 20 ft foundation is a small angle, but the same error on a 3 ft check is a large one, which is why you should always use the largest 3-4-5 multiple that fits inside the layout. Measure twice, adjust, and re-measure after any change.
Exactly 20 ft. It is √(12² + 16²) = √400, a 3-4-5 triangle times 4, 12-16-20. The 3-4-5 check on the short side is 12 ft, 16 ft and 20 ft, which is the same triangle. A deck that measures 20 ft on both diagonals is square; a deck that measures 20 ft on one and 20 ft 1 in on the other is racked and needs a push.
Converters to use with the Square-Up Calculator
Switch units, compare bulk and bagged quantities, or check coverage, without leaving BuildCova.
Lumber, Deck & FenceNominal vs Actual Lumber Size ConverterA 2×4 is really 1½ × 3½ in, every size.
Slope & MeasurementFeet & Inches to Decimal Feet Converter5 ft 6 in = 5.5 ft, both directions.
Slope & MeasurementDecimal Inches to Fraction ConverterTurn 0.6875 in into 11/16 in and back.More framing calculators
FramingRake Wall CalculatorFrame a rake wall, the sloped-top gable-end wall under a pitched roof, without doing the trigonometry on the deck. This rake wall calculator gives you every stud length in order, so you can cut each stud right the first time. Enter the wall length, the low-end height, the roof pitch and the stud spacing, and get every stud length, the common difference between studs, the sloped top plate length, the bevel angle for every stud top, and the total lumber to buy.
FramingMiter Angle CalculatorWork out the saw setting for any miter joint before you cut, so the two faces meet cleanly and you do not waste a board on a wrong angle. This miter angle calculator also covers the angle cut for joining two boards at any corner. Enter the corner angle for a joint, the number of sides for a polygon frame, or the angle for a single cut across one board, and get the miter angle, the saw dial setting, the cut face length, and a reference table for common shapes.
FramingBoard Foot CalculatorA board foot calculator that works out how many board feet of lumber a project needs, what it costs at a price per board foot and how much it weighs, from one board or a whole order. Enter the board size and quantity and the calculator applies the standard board-foot formula, adds your waste allowance and converts the total to cubic feet.
FramingBeam Size CalculatorA beam size calculator that finds the beam that carries your span, so you do not pay for timber you do not need or live with a floor that bounces. Enter the clear span, the tributary width it supports and the live and dead loads, and the calculator checks every size in LVL, glulam or built-up sawn lumber against bending and deflection, and tells you which check fails when a size does not work. Planning estimate only: confirm with your code and a licensed engineer before building.
FramingWindow Rough Opening CalculatorA window rough opening calculator that turns a window unit size into the framed hole it needs, the rough opening, the header length and size, the king and jack studs, the cripples above and below and the rough sill height. Enter the unit size and the shim allowance, and frame it right the first time. The manufacturer published rough opening always wins when it differs.
FramingDoor Rough Opening CalculatorA door rough opening calculator that turns a door size into the framed hole it needs, the rough opening, the header length and size and the jack and king studs, for prehung interior and exterior doors, pocket doors, bifolds and French pairs. Enter the slab size and door type, and the calculator applies that type allowance, including the flooring still to go in.Was this calculator helpful?
Material requirements can vary based on product specifications and job conditions. Verify quantities with your supplier before ordering.