Layout

Diagonal calculator

A 24 ft by 16 ft layout is square when both diagonals measure 28 ft 10-1/8 in. Enter the length and width in feet, inches, and fractions, and this gives the diagonal to the nearest 1/16 in, the largest 3-4-5 triangle that fits inside the layout, and, if you enter the two diagonals you measured, how far out of square it is. Built for squaring a foundation, a slab form, a deck frame, or a wall.

Working out a slope, a pitch, or a stair angle instead? Rise over run calculator

Updated

Enter each side the way your tape reads it: 24 ft, 16 ft 3-1/2 in, or 195-1/2. The diagonal rounds to the nearest 1/16 in.

Check a layout (optional)

Pull both diagonals on the frame or the strings and enter them to see how far out of square it is.

Diagonal
28 ft 10-1/8 in
Diagonal in inches
346-1/8 in
Largest 3-4-5 that fits
15 ft and 20 ft, then 25 ft between the marks
App StoreGoogle Play
Free to download. 7-day trial of everything.

How the math works

The diagonal of a rectangle is the long side of a right triangle, so it follows the Pythagorean theorem: diagonal = √(length² + width²). Once opposite sides measure the same, the layout is square when both diagonals equal that number.

A 3-4-5 triangle is the same rule in whole numbers: 3² + 4² = 5². Mark 3 ft along one side and 4 ft along the other, and the corner is square when the marks are 5 ft apart. Any multiple works: 6-8-10, 9-12-15, 12-16-20. The bigger the triangle, the smaller a tape-reading error is as an angle.

The calculator keeps each side as an exact count of sixty-fourths of an inch, computes the diagonal with integer math, rounds it once to the nearest sixty-fourth, and reads it to the nearest 1/16 in. That is the same rounding the CutOnce app's right-angle solver uses.

A worked example: a 24 ft by 16 ft slab form

Forms for a 24 x 16 garage slab, set on batter boards with string lines.

Target diagonal28 ft 10-1/8 in√(24² + 16²) ft
In inches346-1/8 inrounded to 1/16 in
Largest 3-4-515 ft and 20 ft, 25 ft apart5 × (3-4-5) ft
Square when28 ft 10-1/8 in and 28 ft 10-1/8 inboth diagonals read the target

Set the first corner with the 15-20-25 triangle, then run the other strings and pull both full diagonals. The 3-4-5 squares one corner; with the sides at length, the diagonals check all four.

Fixing an out-of-square layout

Say the diagonals of the same layout read 28 ft 10-5/8 in and 28 ft 9-5/8 in. They differ by 1 in, and each is 1/2 in off the target, one long and one short. Push the corner at the end of the long diagonal toward the inside, a little at a time, until both diagonals read 28 ft 10-1/8 in. Moving a corner changes both diagonals at once, so measure both after every move.

If both diagonals read long, or both short, racking will not fix it: a side is off, or opposite sides do not match. Re-measure the four sides first.

3-4-5 multiples

Use the largest triangle that fits inside the layout. On a 24 x 16 slab, 15-20-25 fits and 18-24-30 does not, because the short side is only 16 ft.

MultipleShort sideLong sideDiagonal
× 13 ft4 ft5 ft
× 26 ft8 ft10 ft
× 39 ft12 ft15 ft
× 412 ft16 ft20 ft
× 515 ft20 ft25 ft

Diagonal chart for common sizes

Target diagonals for common deck, shed, garage, and room sizes, to the nearest 1/16 in.

Size (ft)Diagonal
8 x 811 ft 3-3/4 in
10 x 1014 ft 1-11/16 in
10 x 1215 ft 7-7/16 in
12 x 1216 ft 11-5/8 in
12 x 1620 ft
16 x 1622 ft 7-9/16 in
16 x 2025 ft 7-3/8 in
20 x 2028 ft 3-7/16 in
20 x 2431 ft 2-7/8 in
24 x 2433 ft 11-5/16 in
24 x 3038 ft 5-1/16 in
30 x 4050 ft

What the app adds

This page takes two sides in feet, inches, and fractions. The app's right-angle solver also takes metric sides, solves from any two of the rise, run, diagonal, and pitch, draws the triangle with its dimensions, and rounds to your tape's resolution down to 1/64 in.

How we verify this math

Common questions

How do I square a foundation with the diagonals?
Set the four corners to the right length and width, and check that opposite sides measure the same. Then measure corner to corner both ways: when the two diagonals are equal, the layout is square. For a 24 ft by 16 ft foundation, both should read 28 ft 10-1/8 in.
What is the diagonal of a 12 x 16 rectangle?
Exactly 20 ft, because 12-16-20 is the 3-4-5 triangle times four. A 10 x 12 is 15 ft 7-7/16 in and a 12 x 12 is 16 ft 11-5/8 in.
How does the 3-4-5 rule work?
Three squared plus four squared is 25, which is five squared, so a triangle with sides 3, 4, and 5 has a right angle between the 3 and the 4. Measure 3 ft one way and 4 ft the other from the corner; it is square when the marks are 5 ft apart. Scale it up for a bigger layout.
Is it better to use 3-4-5 or to measure the diagonals?
Use both. A 3-4-5 squares one corner. Once opposite sides measure the same, equal diagonals prove all four corners are square, which a single triangle cannot.
How close do the diagonals need to be?
The residential code sets no single number for it. Hold the tolerance the plans, the engineer, or the next trade calls for: framing, a slab form, and cabinet work each allow a different amount. The calculator shows the difference to the nearest 1/64 in so you can compare it against that tolerance.

Square it before you pour

CutOnce solves right triangles like this page, in imperial or metric, with no signal needed on the jobsite.

Free to download, with a 7-day trial of everything. This page gives the diagonal; the app keeps the layout with the job.

App StoreGoogle Play

See also