Framing calculator

Right Angle Calculator

A right angle calculator that squares corners before a fraction of a degree puts the far end of a 40 ft wall inches off the footing. Enter any two sides of a right triangle to solve the third and both angles, check a corner you have already marked by entering the diagonal you actually measured, or scale the 3-4-5 rule to any size and find a neat multiple that fits your job.

  • Free to use
  • No sign-up
  • Formula and sources shown
Right Angle Calculator

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.

Save this estimate in the app

Solve finds the missing side and angles. Check tests a corner you already marked. 3-4-5 scales the rule to your job.

3

Measured from the corner along the first wall. In 3-4-5 mode this is the leg you scale from (usually the shorter one).

4

Measured from the same corner along the second wall. Leave as is in 3-4-5 mode. It is worked out from side A.

Enter the hypotenuse only if you know it and want the other leg solved. Otherwise leave it blank.

40

Length of the wall or building the corner belongs to. The error at its far end is what decides whether to pull the corner.

Hypotenuse

5.00

Angle opposite side A

36.9°

Angle opposite side B

53.1°

3-4-5 triangle?

Yes | scale 1

Rectangle diagonal (A × B)

5.00

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.

Open this calculator in the app

Formula

Pythagoras: c² = a² + b²; diagonal = √(a² + b²); 3-4-5 scaled: 3k, 4k, 5k; corner angle from a measured diagonal: cos(C) = (a² + b² − d²) ÷ 2ab

Worked example. Mark 3 ft along one wall and 4 ft along the other: the diagonal between the marks should be √(3² + 4²) = √25 = 5 ft exactly, with angles of 36.9° and 53.1°. If the tape reads 5 ft 1 in instead, the corner is 92.4°, 2.4° out of square, and over a 40 ft wall that puts the far end about 20 in off, which is why a 3-4-5 check on a 40 ft wall is a mistake and a 24-32-40 check is the right tool.

Mark 3 ft along one wall and 4 ft along the other, and the diagonal between those marks should be exactly 5 ft, because 3² + 4² = 5². If the tape reads 5 ft, the corner is square. If it reads 5 ft 1 in, the corner is 92.4° and the far end of a 40 ft wall sits about 20 in off the footing. That is the whole of the 3-4-5 rule, because every wall, floor and roof built on an out-of-square corner inherits the error. This page solves any right triangle.

Key takeaways

  • •3-4-5 is Pythagoras in work clothes: 3² + 4² = 5², so a 3, 4 and 5 unit triangle is exactly square. Scale it to 6-8-10, 9-12-15, 12-16-20 or 24-32-40 and it stays square.
  • •The default 3 ft and 4 ft legs give a 5 ft diagonal and angles of 36.9° and 53.1°, the two acute angles of every 3-4-5 triangle, at any scale.
  • •A 1/8 in error on a 5 ft diagonal is about 2 in of error at the far end of a 40 ft wall. A 3-4-5 check on a 40 ft wall is a mistake; use 24-32-40 instead.
  • •A rectangle is square when its two diagonals are equal. A 28 × 40 ft building has diagonals of 48.83 ft, 48 ft 10 in, on both sides.
  • •A measured diagonal longer than √(a² + b²) means the corner is wider than 90°; shorter means it is tighter. The check mode turns the difference into an angle and into inches at the far end.
  • •The triangle should be as big as the work: 3-4-5 for tile, 6-8-10 for wall framing, 9-12-15 or 12-16-20 for foundations, 24-32-40 for a full building.
  • •Measure both legs from the same corner point, with the tape tight and straight. A mark that wanders throws the check off more than any arithmetic error.
  • •The method has no units: 3 m, 4 m and 5 m work exactly like 3 ft, 4 ft and 5 ft, and 300-400-500 mm works on a small box-out.

How to use the right angle calculator

  1. Choose a mode. Solve finds the missing side and angles of a right triangle from any two known sides. Check tests a corner you have already marked. 3-4-5 scales the rule to your job.
  2. In solve mode, enter any two sides, the two legs, or one leg and the hypotenuse, and leave the third blank. The calculator returns the missing side, both acute angles, and whether the triangle is a multiple of 3-4-5.
  3. In check mode, enter the two legs you marked and the diagonal you actually measured with the tape. The calculator returns the diagonal you should have measured, the difference in inches, the real corner angle, and how far out of square the far end of a wall of your length would sit.
  4. In 3-4-5 mode, enter one leg, usually the shorter one, and the length of the job. The calculator returns the scaled triple and the largest neat 3-4-5 multiple whose diagonal fits inside your job, so you can check with the biggest triangle the site allows.
  5. On site, mark the two legs from the same corner point, measure the diagonal between the marks, and pull the corner until the tape reads the expected diagonal. Measure twice, from the same point, before you trust it.
  6. For a whole rectangle, check both diagonals as well: they must be equal. A corner can pass its own 3-4-5 check while the rectangle is still a parallelogram, if the opposite corner is out the other way.

Worked examples

1. The default: solve a 3 ft by 4 ft right triangle

  • Legs: a = 3 ft, b = 4 ft
  • Hypotenuse: c = √(3² + 4²) = √25 = 5 ft exactly
  • Angle opposite the 3 ft leg: arctan(3/4) = 36.9°
  • Angle opposite the 4 ft leg: 90 − 36.9 = 53.1°
  • This is a 3-4-5 triangle at scale 1, the same angles at any scale, from 300 mm to 30 ft
  • Rectangle diagonal for a 3 × 4 ft slab: also 5 ft. The diagonal of the rectangle is the hypotenuse of its corner triangle

2. The check that catches a bad corner: 3 ft and 4 ft legs, tape reads 5 ft 1 in

  • Expected diagonal: √(3² + 4²) = 5 ft exactly
  • Measured diagonal: 5.1 ft, 1.2 in longer than expected
  • Real corner angle: 92.4° by the law of cosines, 2.4° wider than square
  • Over a 40 ft wall, that 2.4° puts the far end about 20.2 in off the footing
  • Fix: pull the corner in until the tape reads 5 ft, then re-check with a bigger triangle, 12-16-20 at least
  • A 1 in error on a 5 ft diagonal is not a small error. It is a wall that does not land on its footing.

3. Squaring a 28 × 40 ft building with the biggest triangle that fits

  • Building diagonal: √(28² + 40²) = √2,384 = 48.83 ft, or 48 ft 10 in. Both diagonals must read the same
  • Largest 3-4-5 multiple that fits a 40 ft job: 24-32-40 (scale 8), diagonal 40 ft
  • Mark 24 ft along one wall and 32 ft along the other; the diagonal between the marks must read 40 ft
  • A 1/8 in error on that 40 ft diagonal puts the far end about a quarter inch out. Eight times more accurate than the same error on a 3-4-5 check
  • Check all four corners, then check both diagonals. When both diagonals read 48 ft 10 in, the building is square.

The 3-4-5 rule, and why it works

The 3-4-5 rule is the Pythagorean theorem with the arithmetic already done. Pythagoras says that in a right triangle, the square on the hypotenuse equals the sum of the squares on the other two sides: c² = a² + b². The numbers 3, 4 and 5 are the smallest whole numbers that satisfy it exactly, 9 + 16 = 25, which means a triangle with sides 3, 4 and 5 is a right triangle, with the right angle between the 3 and the 4. No protractor, no laser, no battery: three measurements and a tape.

Scaling is what makes the rule useful. Multiply all three sides by the same number and the triangle stays right-angled, because the equation still balances: (3k)² + (4k)² = 9k² + 16k² = 25k² = (5k)². So 6-8-10, 9-12-15, 12-16-20 and 24-32-40 are all the same right angle, and the bigger the triangle, the more accurate the check, because the angular error is the measurement error divided by the size of the triangle. A 1/8 in slip on a 5 ft diagonal is a tenth of a degree; the same slip on a 40 ft diagonal is a hundredth of a degree.

ScaleSide ASide BDiagonalBest for
1×3 ft4 ft5 ftTile and flooring layout
2×6 ft8 ft10 ftWall framing and decks
3×9 ft12 ft15 ftFoundations and large rooms
4×12 ft16 ft20 ftFoundations and garages
5×15 ft20 ft25 ftLarge slabs and patios
8×24 ft32 ft40 ftA full 40 ft building wall

The angles never change: 36.9° opposite the short leg and 53.1° opposite the long leg, at every scale. What changes is the accuracy. Use the biggest multiple the site allows.

The rule is older than the tape measure. Egyptian rope-stretchers used a knotted rope with 3, 4 and 5 unit intervals to lay out right angles for pyramids, and carpenters have used it ever since, because it needs no instrument that can go out of calibration. A laser level can be knocked out of true; a knotted rope cannot, as long as the knots are in the right places.

Checking a corner you already marked

The solve mode tells you what the diagonal should be. The check mode tells you what the corner actually is, from the diagonal you actually measured. It uses the law of cosines, which works for any three side lengths: cos(C) = (a² + b² − d²) ÷ 2ab, where d is the diagonal you measured. If d is exactly √(a² + b²), the angle is exactly 90°. If d is longer, the angle is wider than 90°; if d is shorter, it is tighter.

Legs markedExpected diagonalTape readsCorner angleFar-end error on a 40 ft wall
3 ft × 4 ft5 ft 0 in5 ft 0 in90.0°0 in. Square
3 ft × 4 ft5 ft 0 in5 ft 1/8 in90.1°About 2 in
3 ft × 4 ft5 ft 0 in5 ft 1 in92.4°About 20 in
12 ft × 16 ft20 ft 0 in20 ft 1/8 in90.03°About 1/4 in
24 ft × 32 ft40 ft 0 in40 ft 1/4 in90.03°About 1/4 in

The same tape error means eight times less angular error on a 40 ft diagonal than on a 5 ft one. That is the whole argument for the biggest triangle that fits.

The far-end error is the number that makes the point. A corner that is 2.4° out does not look out, you cannot see 2.4° with your eye, but forty feet away the wall is 20 in from where the drawings put it, the sill plate overhangs the footing, and the roof that was framed square does not land on walls that are not. The check mode reports that number because it is the number that decides whether to pull the corner again.

Measure the diagonal twice, and measure it from the same two marks. The most common check-mode error is not arithmetic. It is measuring the diagonal from a different point than the legs were marked from, usually because the corner stake moved when the tape pulled against it. Pin the corner, mark the legs, and measure the diagonal between the marks, not between the stakes.

Squaring a whole building: both diagonals

A single corner check does not square a building. Four corners can each pass their own 3-4-5 check while the building is still a parallelogram. If one corner is out one way and the opposite corner is out the other way by the same amount, every corner reads square and the building is not. The check that catches it is the diagonals: in a rectangle with four right angles, the two diagonals are exactly equal, and in a parallelogram they are not.

Building sizeDiagonal (each)In feet and inchesTolerance worth holding
20 × 30 ft36.06 ft36 ft 3/4 in±1/4 in
24 × 36 ft43.27 ft43 ft 3 1/4 in±1/4 in
28 × 40 ft48.83 ft48 ft 10 in±1/4 in
30 × 50 ft58.31 ft58 ft 3 3/4 in±1/2 in
40 × 60 ft72.11 ft72 ft 1 1/4 in±1/2 in
6 × 9 m10.82 m10,817 mm±6 mm

Diagonal = √(length² + width²). Measure both diagonals corner to corner; if they differ, pull the long-diagonal corners together until they match.

The procedure is: set the four corners roughly, check each corner with the largest 3-4-5 multiple that fits, then measure both diagonals and pull the building until they match. When both diagonals read the same, within a quarter inch on a house, half an inch on a long building, the building is square, and every corner check after that is a confirmation, not a discovery.

The building's position matters as much as its squareness. A square building in the wrong place is the most expensive kind of accurate: check the setbacks from the survey pins before you check the diagonals, because moving a square building is harder than squaring a building that is already in the right place.

For the slopes that meet at those square corners; roof planes, ramps and drainage falls, use the compound slope calculator, which combines two slopes at right angles into one resultant. For the stairs that rise from a squared foundation, the stair calculator works out the risers and treads.

Solving any right triangle

The solve mode is the general case: any two sides of a right triangle determine the third and both angles. With two legs, the hypotenuse is √(a² + b²). With one leg and the hypotenuse, the other leg is √(c² − a²). The angles come from the ratios: the angle opposite a leg is arctan(leg ÷ other leg), and the two acute angles always add to 90°.

KnownFind the hypotenuseFind the other legFind the angles
Two legs a and bc = √(a² + b²)n/aarctan(a/b) and arctan(b/a)
Leg a and hypotenuse cn/ab = √(c² − a²)arcsin(a/c) and 90° − arcsin(a/c)
Leg b and hypotenuse cn/aa = √(c² − b²)arcsin(b/c) and 90° − arcsin(b/c)

The hypotenuse must be longer than either leg. If the numbers you enter make c shorter than a leg, there is no right triangle with those sides. Check the measurements.

On a job site the solve mode answers questions that are not about squareness at all: the length of a diagonal brace across a 4 ft by 8 ft sheet (√(4² + 8²) = 8.94 ft), the rafter length for a known rise and run, the length of a stair stringer from the total rise and the total run. Any right triangle is the same three numbers, and the calculator does not care whether the triangle is a foundation corner or a roof.

The calculator also tells you whether the triangle is a multiple of 3-4-5. A 9-12-15 triangle is, and its angles are 36.9° and 53.1°; a 5-12-13 triangle is a different Pythagorean triple, with angles of 22.6° and 67.4°, and it is just as square, 5² + 12² = 13². The 3-4-5 family is the most useful on site because the numbers are small, not because it is the only one.

Common right angle mistakes

  • •Checking a 40 ft wall with a 3-4-5 triangle. A 1/8 in error on the 5 ft diagonal is 2 in at the far end. Use 24-32-40 instead.
  • •Measuring the legs from different points. Both legs and the diagonal must be measured from the same corner point, or the check is meaningless.
  • •Checking one corner and calling the building square. Check all four corners, then check both diagonals. A parallelogram can pass a corner check.
  • •Trusting a diagonal measured with a sagging tape. A tape that sags reads long, and a long diagonal reads as a wide corner that is not there.
  • •Forgetting that the diagonal of a rectangle is the hypotenuse of its corner triangle. The same √(a² + b²) does both jobs.
  • •Using a small triangle because it is convenient. The triangle should be as big as the work, not as big as the tape you happen to have out.
  • •Squaring the building before checking the setbacks. A square building in the wrong place is the most expensive kind of accurate.
  • •Rounding the diagonal to the nearest inch on a long building. On a 48 ft diagonal, an inch is a real error. Read the tape to an eighth.

How this calculator compares with the rivals

The squaring search is crowded with single-purpose checkers: most of them do one thing, the diagonal, or the 3-4-5 scaling, or the angle, and stop. None of them does all three in one place, and none of them turns a measured diagonal into inches of error at the far end of a wall. That is the gap this page fills.

RivalWhat it offersWhere this page beats it
BuildItCalc | Right Angle CalculatorRight-triangle solving for construction layoutThe namesake rival solves the same triangle, but gives only the missing side. This page adds the check mode with the real corner angle and the far-end error, and the 3-4-5 mode with the largest multiple that fits the job.
FieldCalc. 3-4-5 Square CalculatorDiagonal from two legs, largest neat 3-4-5 multiple, and the 1/8-in-on-5-ft warningThe strongest rival on site practice. This page adds the full solve mode for any two sides, the check mode with the law-of-cosines angle, and the both-diagonals table for whole buildings.
MiniWebTool | Squareness CheckerExpected diagonal, actual angle by law of cosines, accuracy score, both diagonals, reference tablesThe deepest rival on checking. This page adds the solve mode, the 3-4-5 scaling with the largest multiple for the job size, and the far-end error in inches, the number that decides whether to pull the corner.
InchCalculator | Squaring CalculatorDiagonal measurement, the 3-4-5 rule, and the equal-diagonals method for foundations and decksGood on the diagonal method. This page adds the check mode with the actual angle, the 3-4-5 scaling table, and the solve mode for braces, rafters and stringers.
BraveCalculator | 3-4-5 Rule CalculatorScaled 3-4-5 triples from one input side, with worked examplesGood on scaling. This page adds the check mode, the solve mode for any two sides, and the accuracy argument for using the biggest triangle that fits.
STCalculator. Square CalculatorArea, perimeter, diagonal and radius of a square, with a construction check sectionA geometry page with a construction note. This page covers the job site: check mode, far-end error, both diagonals, and the tolerance table.
CalculatorSoupNo right angle layout calculator in the top results for this keywordIts strength is general-purpose calculators.
Home Depot / Lowe'sNo right angle layout calculator in the top resultsThis page answers the check and names the triangle to use.

The honest summary: FieldCalc and MiniWebTool are the rivals to watch, because they already think about accuracy and about the actual angle. No rival offers the solve mode, the check mode with the far-end error in inches, and the 3-4-5 mode with the largest multiple for the job size in one place. This page wins by being the only one that does all of it, and by explaining, with numbers, why the size of the triangle is the accuracy.

Assumptions

  • •All measurements are taken from the same corner point, on the same level, with the tape pulled tight and straight. A tape that sags, a mark that wanders or a corner point that moves between measurements throws the check off more than any arithmetic error.
  • •The check mode assumes the two legs are straight and the diagonal is measured between their ends. It reports the actual corner angle from the law of cosines, so it works for any two side lengths, not only 3-4-5.
  • •The 1/4 in tolerance in the check is a rule of thumb for framing layout, not a code number. Foundations are usually held tighter (±1/4 in on the diagonal over the whole building) and tile looser; follow the tolerance on your drawings.
  • •A right angle on the ground is only as good as the triangle you check it with. The error at the far end of a wall is the angular error times the wall length, so a bigger triangle is always more accurate than a small one.

Sources✓ Verified

  • Pythagorean theorem (Euclid, Elements I.47). In a right triangle the square on the hypotenuse equals the sum of the squares on the other two sides. The basis of every check on this page.
  • Law of cosines. The corner angle from three measured sides: cos(C) = (a² + b² − d²) ÷ 2ab, used by the check mode.
  • Field practice for squaring foundations and decks. Use the largest 3-4-5 multiple that fits; check both diagonals of a rectangle; a 1/8 in error on a 5 ft diagonal is about 2 in at 40 ft.

Formula reviewed November 2026.

Measure 3 units along one side of a corner and 4 units along the other. If the diagonal between those two marks is exactly 5 units, the corner is a perfect right angle, because 3² + 4² = 9 + 16 = 25 = 5². Pull the corner until the tape reads 5, and it is square. Scale it to any size: 6-8-10, 9-12-15, 12-16-20 and 24-32-40 are all the same right angle, and the bigger ones are more accurate.

Measure both diagonals of the rectangle. If they are equal, the corners are square; if they differ, the layout is out. For a 28 × 40 ft building the diagonal should be √(28² + 40²) = 48.83 ft, or 48 ft 10 in, on both diagonals. Also check each corner with the largest 3-4-5 multiple that fits, 24-32-40 on a 40 ft wall, because a diagonal check alone does not tell you which corner is out.

The biggest that fits the job. A 3-4-5 check on a 40 ft wall is a mistake: a 1/8 in error on the 5 ft diagonal is about a tenth of a degree, and forty feet away that is 2 in of wall hanging over the footing. Use 24-32-40 on a 40 ft wall. The same 1/8 in on a 40 ft diagonal puts the far end a quarter inch out. The rule is simple: the triangle should be as big as the work.

With two legs a and b, the hypotenuse is √(a² + b²) and the angles are arctan(a/b) and arctan(b/a). With one leg and the hypotenuse, the other leg is √(c² − a²). This calculator's solve mode does all three cases: enter any two sides and it returns the third, both acute angles, and whether the triangle is a multiple of 3-4-5.

A diagonal longer than √(a² + b²) means the corner is wider than 90°. The two sides are spread apart. A diagonal shorter than expected means the corner is tighter than 90°. This calculator's check mode turns the difference into an actual angle and into inches of error at the far end of your wall, so you know which way to pull the corner and by how much.

Yes. The ratio has no units. 3 m and 4 m give a 5 m diagonal, and 300-400-500 mm works on a small box-out. The calculator is unit-agnostic: enter feet, metres or inches, as long as all three measurements use the same unit, and the diagonal comes back in that unit.

Converters to use with the Right Angle Calculator

Switch units, compare bulk and bagged quantities, or check coverage, without leaving BuildCova.

Browse all converters

More framing calculators

Wall Framing CalculatorFramingWall Framing CalculatorA wall framing calculator that works out the full lumber list for a framed wall, not just a stud count. Enter the wall length and height, the stud spacing and the windows and doors, and the calculator gives you every piece: the field studs, the king and jack studs at each opening, the corner studs, the double top plate and bottom plate, the headers, the cripple studs and the sheathing sheets. It is the list you take to the lumber yard.Fastener Spacing CalculatorFramingFastener Spacing CalculatorA fastener spacing calculator that gives you the maximum spacing the code allows, the edge distance the fastener must keep, and the fastener count for the run. A deck board fastened with screws goes 16 in on centre, and a 12 ft run needs 10 screws, one at each joist crossing plus one at the start. A fastener that is too far apart holds nothing, and a fastener that is too close to the edge splits the wood, so check it before you drive the first one.Stair CalculatorFramingStair CalculatorA stair calculator that turns your total rise, floor to floor or ground to deck, into the riser count, tread count, actual riser height and total horizontal run. It works for deck stairs, porch steps, basement stairs and full flights. Uneven risers trip people; a wrong run lands the last step past the landing, so get both numbers before you cut a stringer.Lumber Board Feet CalculatorFramingLumber Board Feet CalculatorThis board feet calculator converts your lumber's nominal dimensions and quantity into total board feet, the standard unit lumber is priced and sold by, so you can check a quote and estimate the cost before you buy. Enter the thickness, width, length and number of boards. Ten 2 by 6 boards, 8 ft long, are 8 board feet each, or 80 board feet in total.Wall Stud CalculatorFramingWall Stud CalculatorA wall stud calculator that turns your wall length and on-center spacing into the stud count for framing it, then adds plates, corners and openings. Miss studs and the framing stops mid-wall while you wait for lumber; over-order and long studs fill the garage. Enter the length and spacing and get the count before you buy.Ramp Slope CalculatorFramingRamp Slope CalculatorThis ramp slope calculator turns your vertical rise and chosen slope ratio into the horizontal run, total ramp length and incline angle you need, so you can build a ramp that is safe to use and fits the space. Then plan landings and handrails around it. A 24 in rise at the ADA maximum 1:12 slope needs a 288 in, or 24 ft, run, a ramp length of about 24.1 ft and an angle of about 4.76 degrees.

Material requirements can vary based on product specifications and job conditions. Verify quantities with your supplier before ordering.