Diagonal Pythagorean Calculator

MEASURING & LAYOUT

Find a diagonal or check a layout for square using the Pythagorean theorem. Enter two sides; add your measured diagonal to test whether a corner is truly 90 degrees.

abc (diagonal)
Diagonal
Hypotenuse of the two sides.

Usage Tip

For big jobs use multiples of 3-4-5 (like 6-8-10) for more accuracy. Adjust one corner until the two diagonals match exactly before you fasten anything.

THE MATH
Diagonal c = √(a² + b²)
A corner is square when the measured diagonal equals c
3-4-5 rule: sides of 3 and 4 give a 5 diagonal
The Pythagorean theorem: in a right triangle the diagonal (hypotenuse) squared equals the sum of the other two sides squared.
To check a rectangle for square, its two diagonals must be equal; this gives the target length.
To square a layout, measure both diagonals of the rectangle — they are equal only when all four corners are 90°.
The 3-4-5 method scales: 6-8-10 or 9-12-15 work the same and are easier on big layouts.
Small errors compound over distance; re-check square after fastening, since nailing can shift things.

What Is the Pythagorean Theorem?

For any right triangle, the square of the long side (the hypotenuse or diagonal) equals the sum of the squares of the other two sides. In building terms: if two walls meet at a true 90 degree corner, the diagonal between their ends is fixed by their lengths. That single fact is how you square walls, decks, slabs, and entire foundations – and how you discover when they are not square.

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

The 3-4-5 Rule for Squaring Corners

The fastest field trick: measure 3 units along one wall and 4 units along the other from the corner. When the diagonal between those two marks is exactly 5 units, the corner is a perfect 90 degrees. Use any unit, and use a bigger multiple (6-8-10, 9-12-15, 12-16-20) for longer walls – the larger the triangle, the more accurate the corner.

MultipleTriangle (a-b-c)
1x3 – 4 – 5
2x6 – 8 – 10
3x9 – 12 – 15
4x12 – 16 – 20
5x15 – 20 – 25
6x18 – 24 – 30
10x30 – 40 – 50

Squaring a Building, Deck, or Slab

To square a rectangle, lay out the two side lengths, then measure the two diagonals corner to corner. If both diagonals are equal, the rectangle is square. The calculator above gives the target diagonal for your dimensions so you can compare. If the diagonals differ, gently rack the frame (push one corner) until they match – a few minutes here saves crooked walls, gapped flooring, and out-of-square cabinets later.

Framing Square Guide

A framing square has a 16 inch tongue and 24 inch blade meeting at 90 degrees – itself a built-in right triangle. It is perfect for squaring small work and marking rafters, but for room- or building-scale layout the 3-4-5 method and equal-diagonals check are far more accurate, because small errors in a hand square multiply over long runs.

Flooring Layout Guide

Before laying tile or planks, square the room off a reference wall using a 3-4-5 line, then snap your starting chalk line from that. Working off an out-of-square wall is the classic cause of tile rows that drift visibly out of parallel by the far side of the room. Check the room diagonals first and plan your layout from the squared line, not the wall.

Common Diagonals Chart

RectangleDiagonal
10 x 10 ft14.14 ft
10 x 12 ft15.62 ft
12 x 16 ft20.00 ft
16 x 20 ft25.61 ft
20 x 30 ft36.06 ft

Deck, Room & Slab Examples

Deck: a 12 x 16 ft deck frame should measure 20.00 ft on both diagonals before you fasten the joists. Room: a 10 x 12 ft room has a 15.62 ft diagonal – mark it before tiling. Slab: stake a concrete form, then confirm both diagonals match (a 20 x 30 ft slab should read 36.06 ft each way) before pouring – concrete does not forgive an out-of-square form. Framing: square each wall to the deck with a 3-4-5 (or 6-8-10) before sheathing. Shed foundation: stake the perimeter, then equalize both diagonals before setting posts or pouring footings. Wall layout: snap the bottom plate to a 3-4-5 line off your reference edge so the wall starts square.

Example: Square a 12 x 16 Deck

A 12 by 16 ft deck frame is square when both diagonals measure exactly 20.00 ft – 12 squared (144) plus 16 squared (256) is 400, and the square root of 400 is 20. Build the frame, measure corner to corner both ways, and rack it until both diagonals read 20 ft before you fasten anything.

Acceptable Squareness Tolerances

How close to perfect is good enough depends on what you are building:

StructureAcceptable diagonal error
Concrete slabunder 1/4 in
Deck frameunder 1/4 in
Shed floorunder 1/2 in
Wall layoutunder 1/4 in
Rough framingunder 1/2 in

Finish work like tile and cabinets demands less; large rough structures tolerate a little more. Out of square mode grades your measured diagonal against these thresholds.

Common Measuring Mistakes

  • Trusting one corner instead of checking both diagonals.
  • Using a 3-4-5 triangle too small for a long wall (errors magnify).
  • Measuring to different reference points on each diagonal.
  • Squaring off a wall that is not itself straight.
  • Ignoring construction tolerance – expect to be within a fraction of an inch, not perfect.

Frequently Asked Questions

What is the Pythagorean theorem?

In a right triangle, the diagonal squared equals the sum of the two sides squared: c = the square root of (a squared plus b squared).

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

Measure 3 ft along one wall and 4 ft along the other from the corner. Adjust until the diagonal between the marks is exactly 5 ft – then the corner is 90 degrees.

How do I check if a room is square?

Measure both diagonals corner to corner. If they are equal, the room is square. Use the calculator to get the target diagonal for your dimensions.

What is the diagonal of a 12 x 16 room?

Exactly 20 ft – one of the cleanest right triangles (3-4-5 scaled by four).

How do I square a deck or slab?

Lay out the sides, then make both diagonals equal to the target from this calculator. Rack the frame until they match before fastening or pouring.

Why measure both diagonals?

Equal sides alone do not guarantee square corners; only equal diagonals confirm the rectangle is truly square.

What if my diagonal measurements do not match?

The rectangle is out of square. Switch to Out of square mode to see how far off it is in inches, then rack the frame toward the longer diagonal until both diagonals are equal.

Related Measuring & Layout Calculators

Note: results are rounded for display, so a value shown as 20.00 ft may carry tiny rounding. Field measurements vary – tapes stretch, marks have width, and lumber is imperfect – so aim for diagonals within a fraction of an inch rather than exact. Larger 3-4-5 multiples give better accuracy on long runs. General construction guidance, not a substitute for verifying your own layout.

Spotted an error or have a suggestion for this calculator? Let us know →
Scroll to Top

The calculators and tools on Formula Factory are provided for general guidance and informational purposes only. Results are estimates based on standard formulas and the values you enter — they do not constitute professional engineering, electrical, or architectural advice. Always verify calculations with a qualified professional before making decisions for any safety-critical, code-compliance, or commercial application. Formula Factory makes no representations or warranties as to the accuracy or completeness of any result, and accepts no liability for errors, omissions, or any outcomes arising from reliance on this information.