d = √(W² + H²)

Diagonal Brace Calculator

Enter the width and height of a gate, frame, or shelf to get the brace length from corner to corner and the angle to cut at each end.

Last reviewed:

Work out a diagonal brace

A diagonal brace turns a rectangle that could fold into a parallelogram into two rigid triangles. The brace is the hypotenuse of a right triangle whose legs are the frame's width and height, so its length is √(W² + H²) and its angle to the rails is arctan(H ÷ W).

Enter the width and height in feet and inches or in centimeters. The calculator gives the brace length to the nearest 1/16 in or 1 mm, the angle where the brace meets the frame at each end, and the matching miter saw settings. It's set up with a gate 4 ft wide and 6 ft tall.

Enter the frame

Measure across and up between the two corners the brace will join.

Width
Height

Results

Brace length, corner to corner
7 ft 2 9/16 in 7.211 ft

From corner to corner of the 4 ft by 6 ft frame, to the nearest 1/16 in. Cut the board a little long and mark the ends in place.

Cut angle at each end
To the top and bottom rails
56.3°
To the sides
33.7°

Both ends meet the frame the same way: 56.3° to the top and bottom rails and 33.7° to the sides. The two always add up to 90°.

Miter saw setting
  • End that sits on a rail: 33.7°
  • End that sits against a side: 56.3° (mark it by hand)

On a miter saw, where 0° is a square cut, an end that sits on a rail is cut at 33.7°, and an end that sits against a side at 56.3°.

Diagonal brace calculator diagram: a 4 ft by 6 ft gate with a brace from the bottom hinge corner to the top latch corner A 4 ft wide by 6 ft tall frame with hinges on the left side and a diagonal brace from the bottom of the hinge side to the top of the latch side. The brace is about 7 ft 2 9/16 in long and meets the top and bottom rails at 56.3° and the sides at 33.7°. Both ends: 56.3° to the rails, 33.7° to the sides W = 4 ft Hinge side H = 6 ft 7 ft 2 9/16 in 56.3° 33.7°

How it’s worked out

W is the width and H the height, in decimal feet. θ is the brace’s angle to the rails, φ its angle to the sides.

  1. Brace length
    d = √(W² + H²)
    = √(4² + 6²) = √52
    ≈ 7.2111 ft ≈ 7 ft 2 9/16 in
  2. Angle to the rails
    θ = arctan(H ÷ W)
    = arctan(6 ÷ 4) = arctan(1.5)
    ≈ 56.31°, shown as 56.3°
  3. Angle to the sides
    φ = 90° − θ
    ≈ 90° − 56.31°
    ≈ 33.69°, shown as 33.7°

Where the brace goes

A gate hangs from hinges on one side, and its own weight pulls the other side, the latch side, down. Without a brace, the frame racks into a parallelogram and the latch corner drops. As it does, the diagonal from the bottom of the hinge side to the top of the latch side gets shorter. A wooden brace along that diagonal is squeezed end to end, which wood resists well, so it holds the latch corner up and carries the weight back to the bottom hinge. That's why the diagram puts the hinges on the left and runs the brace from bottom left to top right.

Other frames follow the same idea: the brace runs along the diagonal that the load would shorten. Under a wall shelf, it runs from low on the wall up to the front of the shelf, with the shelf's depth as the width and the drop down the wall as the height. A frame that only needs to stay square, such as a shed wall before it's sheathed, can take the brace either way.

Worked example: bracing a 4 ft by 6 ft gate

A fence gate is 4 ft wide and 6 ft tall, hinged on the left. The brace runs from the bottom corner on the hinge side to the top corner on the latch side.

  1. Length: d = √(4² + 6²) = √(16 + 36) = √52 ≈ 7.2111 ft.
  2. On a tape: keep the 7 ft, then 0.2111 × 12 ≈ 2.533 in. Keep the 2 in, then 0.533 × 16 ≈ 8.53 sixteenths, which rounds to 9. The brace is 7 ft 2 9/16 in from corner to corner, or 7.211 ft.
  3. Angle to the rails: θ = arctan(6 ÷ 4) = arctan(1.5) ≈ 56.3°. Angle to the sides: 90° − 56.3° = 33.7°.
  4. Cuts: where an end sits flat on the top or bottom rail, set the miter saw to 33.7°. Where it butts against a side, the setting is 56.3°, past the scale on many saws, so mark that line by hand.

Both ends get the same pair of angles, so the two cuts are parallel when both ends sit on rails. In metric, a gate 90 cm wide and 120 cm tall takes a brace of exactly 150 cm, since 90-120-150 is the 3-4-5 triangle 30 times over, at 53.1° to the rails and 36.9° to the sides. To give answers like these as tape readings for any right triangle, use the right triangle calculator in feet and inches.

Brace lengths for common frames

Frame Width × height Brace To the rails To the sides
Garden gate 3 ft × 4 ft 5 ft 53.1° 36.9°
Narrow side gate 3 ft × 6 ft 6 ft 8 1/2 in 63.4° 26.6°
Fence gate 4 ft × 6 ft 7 ft 2 9/16 in 56.3° 33.7°
Wide fence gate 5 ft × 6 ft 7 ft 9 3/4 in 50.2° 39.8°
Low wide gate 6 ft × 4 ft 7 ft 2 9/16 in 33.7° 56.3°
Shelf bracket 1 ft × 1 ft 1 ft 5 in 45° 45°
Garden gate 90 cm × 120 cm 150 cm 53.1° 36.9°
Fence gate 100 cm × 180 cm 205.9 cm 60.9° 29.1°

Lengths are corner to corner, rounded to the nearest 1/16 in or 1 mm, and angles to 0.1°. For the shelf bracket, the width is the shelf's depth and the height is the drop down the wall.

Cutting and fitting the brace

  1. Square the frame first: make both diagonals equal, then tack a temporary strip across a corner so it can't move. The 3-4-5 rule calculator shows what the diagonals should read.
  2. Cut the brace board a few inches longer than the calculated length.
  3. Lay it across the frame along the diagonal and mark each end where it meets the rail or side. The marks should match the angles above.
  4. Cut just outside each line, test the fit, and trim until the brace drops in snugly without bowing the frame.

Marking in place takes care of the board's width, which the corner-to-corner length leaves out. A snug fit matters more than an exact length: a brace with a gap at one end lets the gate sag until the gap closes.

Diagonal brace FAQ

Which way should a brace go on a gate?

From the bottom corner on the hinge side up to the top corner on the latch side. That is the diagonal that gets shorter as a gate starts to sag, so a wooden brace along it is pushed end to end and props the latch side up. A brace on the other diagonal is pulled instead, and only the nails or screws at its ends resist the sag. A steel cable with a turnbuckle is the exception: it can only pull, so it runs from the top of the hinge side down to the bottom of the latch side.

Do I measure the inside or the outside of the frame?

Measure where the brace will sit. If it fits inside the frame, between the rails and the sides, measure the opening between their inside faces. On a Z-braced gate, where the brace runs across the back between two horizontal boards, the height is the gap between those boards and the width is how far across the brace travels. Square the frame before you measure: a frame that is out of square has one long and one short diagonal, and a brace cut to fit it would hold it that way.

What do I set my miter saw to for the brace?

A miter saw reads 0° for a square cut, so set it to 90° minus the angle the brace makes with the part its end sits against. An end that sits on a top or bottom rail meets it at the rail angle, so the saw goes to the side angle, and the other way round. For a 4 ft by 6 ft gate, that is 33.7° for an end on a rail and 56.3° for an end against a side. Many miter saws stop at 45° to 50°, so for a steeper cut, mark the line with a speed square or a sliding bevel and cut it with a circular saw or a hand saw.

Why doesn’t a brace cut to the full diagonal fit?

Because the board has width. The calculator’s length runs along a line from corner to corner, but a brace board several inches wide can’t push its whole end into a corner: its edges reach the rails and sides before its center line does. The finished brace ends up shorter than the diagonal and sits at a slightly different angle, and the wider the board and the smaller the frame, the bigger the difference. Use the calculated length to buy and rough-cut the board, then lay it across the frame and mark both cuts in place.

What if my gate is wider than it is tall?

Then the brace lies flatter than 45°, and less of its push goes into holding the latch side up. Only the upward part of the push does that job, and that part is the push times the sine of the brace’s angle to the rails: about 71% at 45°, 55% at 33.7° (a gate 6 ft wide and 4 ft tall), and 37% at 21.8° (10 ft wide and 4 ft tall). For a wide gate, add an upright in the middle and brace each half on its own, so each brace stands steeper.

To find the diagonal of any right triangle, use the hypotenuse calculator. See the full right triangle FAQ for more general questions.

Cite this page

To cite this calculator in schoolwork or a report, you can use this reference (APA style):

Right Triangle Calculators. (2026, November 10). Diagonal brace calculator. https://righttrianglecalculators.com/diagonal-brace-calculator

References

The formulas and definitions on this page match these standard references.

  1. Weisstein, Eric W. “Pythagorean Theorem.” MathWorld, Wolfram Research.
  2. Weisstein, Eric W. “Inverse Tangent.” MathWorld, Wolfram Research.
  3. Weisstein, Eric W. “Rectangle.” MathWorld, Wolfram Research.

3-4-5 rule calculator

Square a deck, foundation, or room: the diagonal to measure and a check of both diagonals.

Feet and inches triangle calculator

Type tape readings like 5' 6 3/8" and get every side to the nearest 1/16 in.

Hypotenuse calculator

Find the hypotenuse from two legs, a leg and an angle, the area, or the perimeter.

Right triangle calculator

Find the area, sides, and angles of any right triangle from any 2 known values.

Pythagorean theorem calculator

Find the missing side of a right triangle, or check if 3 sides form one.

Right triangle formulas

Every right-triangle formula in one reference sheet.