Gable Roof Calculator
The rise and peak height of a gable roof, the area of its gable ends and the length of every gable stud, plus the roof area with its ridge, eaves and rakes.
By Marko Visic, BSc Physics · Updated November 25, 2026
The building
Measure the width from the outside of one wall to the outside of the other. Wall height runs from the floor to the top of the wall plate.
Overhangs and framing
The spacing sets both the rafters and the gable studs.
Rise: the run is 24 ÷ 2 = 12 ft, and the total rise 12 × 6 = 72 in (6 ft 0 in), the units of run times the unit rise; slope atan(6 ÷ 12) = 26.57°.[1]
Peak: the walls stand 8 × 12 = 96 in, so the rafters' theory line at the ridge is 96 + 72 = 168 in (14 ft 0 in) above the floor. The top of the framing sits higher by the rafter's height above the plate.
Common rafter: unit line length √(12² + 6²) = 13.42 in, so 12 × 13.42 = 161.04 in (13 ft 5 1/16 in) from the birdsmouth plumb cut to the ridge center, and a tail of 1 × 13.42 = 13.42 in.[1]
Gable ends: 72 ÷ 12 = 6 ft of rise, so each triangle above the top plate is 24 × 6 ÷ 2 = 72 sq ft, and both 2 × 72 = 144 sq ft, up to the rafters' theory line.
Gable studs at 16 in on center, the first under the center of the gable: 24 × 12 ÷ 2 = 144 in from the center to each wall, 144 ÷ 16 = 9 spacings, so 9 − 1 = 8 studs on each side of the center one, 1 + 2 × 8 = 17 a gable end and 2 × 17 = 34 in all.[1] Each runs from the top plate to the theory line: its distance from the nearest wall in feet times the unit rise, and neighbors differ by 16 ÷ 12 = 1.333 and 1.333 × 6 = 8 in.[1]
| From the nearest wall, ft = in ÷ 12 | Length, in = ft × 6 | Studs, per end × 2 = both |
|---|---|---|
| 12 | 72 = 6 ft 0 in | 1 × 2 = 2 |
| 10.667 | 64 = 5 ft 4 in | 2 × 2 = 4 |
| 9.333 | 56 = 4 ft 8 in | 2 × 2 = 4 |
| 8 | 48 = 4 ft 0 in | 2 × 2 = 4 |
| 6.667 | 40 = 3 ft 4 in | 2 × 2 = 4 |
| 5.333 | 32 = 2 ft 8 in | 2 × 2 = 4 |
| 4 | 24 = 2 ft 0 in | 2 × 2 = 4 |
| 2.667 | 16 = 1 ft 4 in | 2 × 2 = 4 |
| 1.333 | 8 | 2 × 2 = 4 |
These are theory lengths, to the rafters' theory line. The cut depends on how each stud is set: edge-on with its top notched to fit the rafter, or flatwise with its top cut to the slope.[1]
Rafters: 30 × 12 ÷ 16 = 22.5 → 23 spaces, 23 + 1 = 24 a side with one on each end wall, and 2 × 24 = 48 in all.
Roof surface: overhangs of 12 ÷ 12 = 1 ft at the eaves and 12 ÷ 12 = 1 ft at the gables, so at the edges 30 + 2 × 1 = 32 by 24 + 2 × 1 = 26 ft, 32 × 26 = 832 sq ft in plan; multiplier √(1 + (6 ÷ 12)²) = 1.118034, so 832 × 1.118034 = 930.2 sq ft, or 930.2 ÷ 100 = 9.3 squares.[3]
Edges: the ridge 32 ft, the eaves 2 × 32 = 64 ft, and each rake from the eave edge to the peak (12 + 1) × 1.118034 = 14.53 ft, 4 × 14.53 = 58.12 ft for the four.
Gable overhang: a 12 in gable overhang is past the 9 in that panel sheathing may cantilever beyond the gable endwall, so it needs gable overhang framing under it (2024 IRC R803.2.3).[2] The Navy frames it with fly (barge) rafters tied to the ridgeboard and the fascia board, and blocking on the end wall between each fly rafter and the rafter next to it.[1]
A gable roof calculator turns a building's width, length and pitch into the roof's rise, its peak height, the rafter line length, the gable-end area and the roof surface. This one also lays out the gable studs the way the U.S. Navy's Builder Basic does, from the center of the gable out: each stud's length is its distance from the nearest wall times the unit rise.[1]

Drawing: CalculateMyRoof · CC BY 4.0 · How to reuse
How it works
A gable roof has two planes that meet at a level ridge, with a triangular wall, the gable end, at each end. The calculator follows the Navy's roof triangle: the total run is half the span, and the total rise is the unit rise times the units of run, with a unit run of 12 in for common rafters.[1] The common rafter's line length runs from the outside edge of the top plate to the center of the ridge: its unit line length, the bridge measure, times the units of run.[1]
Those numbers are taken on the rafters' theory line, which starts at the top of the wall plate at the outside of the wall. Gable studs stand on the top plate and reach that line, so each one is as long as the roof rises over its distance from the nearest wall, and neighbors differ by the spacing in feet times the unit rise, the common difference.[1]
Worked example
A building 24 ft wide and 30 ft long at 6:12, with 12 in eave and gable overhangs, 8 ft walls and framing 16 in on center:
- Rise: run 24 ÷ 2 = 12 ft, total rise 12 × 6 = 72 in, slope atan(6 ÷ 12) = 26.57°.[1]
- Peak: 8 × 12 = 96 in of wall, so the theory line at the ridge stands 96 + 72 = 168 in (14 ft 0 in) above the floor.
- Common rafter: √(12² + 6²) = 13.42 in per foot of run, and 12 × 13.42 = 161.04 in (13 ft 5 1/16 in) from the birdsmouth to the ridge center, plus a 1 × 13.42 = 13.42 in tail.[1]
- Gable ends: 72 ÷ 12 = 6 ft of rise, so 24 × 6 ÷ 2 = 72 sq ft each and 2 × 72 = 144 sq ft for both.
- Gable studs: 24 × 12 ÷ 2 = 144 in from the center to each wall, 144 ÷ 16 = 9 spacings, so 9 − 1 = 8 studs each side of the center one, 1 + 2 × 8 = 17 a gable end and 2 × 17 = 34 in all; the center one, under the ridge, is 12 × 6 = 72 in, and each step toward a wall is 16 ÷ 12 = 1.333 and 1.333 × 6 = 8 in shorter.[1]
- Rafters: 30 × 12 ÷ 16 = 22.5 → 23 spaces, 23 + 1 = 24 a side and 2 × 24 = 48 in all.
- Roof surface: the overhangs are 12 ÷ 12 = 1 ft at the eaves and 12 ÷ 12 = 1 ft at the gables, so 30 + 2 × 1 = 32 by 24 + 2 × 1 = 26 ft, 32 × 26 = 832 sq ft in plan, and with √(1 + (6 ÷ 12)²) = 1.118034, 832 × 1.118034 = 930.2 sq ft, or 930.2 ÷ 100 = 9.3 squares.[3]
- Edges: eaves 2 × 32 = 64 ft, rakes (12 + 1) × 1.118034 = 14.53 ft each and 4 × 14.53 = 58.12 ft in all, and the ridge as long as the roof.
Gable roof formulas
- Run = width ÷ 2; total rise = run in feet × unit rise.[1]
- Peak above the floor = wall height + total rise, on the rafters' theory line.
- Rafter line length = run × √(12² + rise²), in inches; tail = eave overhang in feet × the same root.[1]
- Gable end = width × total rise in feet ÷ 2.
- Gable stud = its distance from the nearest wall in feet × unit rise, laid out from the center; common difference = spacing ÷ 12 × unit rise.[1]
- Roof area = (length + 2 × gable overhang) × (width + 2 × eave overhang) × √(1 + (rise ÷ 12)²).
- Rake = (run + eave overhang) × the same multiplier, from the eave edge to the peak.
The gable end and its studs
The gable end is the triangle of wall above the top plate. Its area, width times rise over two, is what siding and sheathing cover there, on top of the rectangle of wall below. The Navy lays out the studs that frame it from the center of the gable: the first directly under the peak, or half a window or vent opening to each side of the center line, then the framing spacing out to the walls. The two halves mirror each other, so the calculator lists each length once with how many a gable end takes, and it assumes no opening.[1]
The lengths are theory lengths, from the top plate to the rafters' theory line. The cut depends on how each stud is set: edge-on, even with the outside wall, its top notched to fit the rafter; or flatwise, its top cut to the slope.[1]
Framing a gable overhang
Panel roof sheathing may cantilever no more than 9 in past the gable endwall unless gable overhang framing supports it (2024 IRC R803.2.3).[2] The U.S. Navy's Builder Basic frames a gable overhang with fly rafters, also called barge or fascia rafters, tied to the ridgeboard at the top and the fascia board at the bottom. Either blocking rests on the end wall, nailed between each fly rafter and the rafter next to it, or a common rafter sits directly over each gable end and the fly rafters run between the ridgeboard and the fascia boards.[1] The calculator flags a gable overhang past the limit; it doesn't size the framing.
How to measure a gable roof
- Width. Measure across the building from the outside of one long wall to the outside of the other, on the wall framing.
- Length. Measure along a long wall, end wall to end wall; the ridge runs the same way.
- Pitch. Find the rise per foot of run with the roof pitch calculator, or take it from the plans.
- Overhangs. Measure the eave overhang level from the wall to the end of the rafter tails, and the gable overhang from the gable wall to the outside of the barge rafter.
- Wall height. Measure from the floor to the top of the wall plate.
Common questions
How do you calculate the height of a gable roof?
Multiply half the width in feet by the unit rise, then add the walls: 12 × 6 = 72 in of rise on a 24 ft building at 6:12, and 96 + 72 = 168 in above the floor with 8 ft walls.[1] The top of the framing sits higher by the rafter's height above the plate, which the rafter length calculator gives for your rafter.
How do you work out the area of a gable end?
Multiply the width by the rise in feet and halve it: 24 × 6 ÷ 2 = 72 sq ft in the worked example, for each end.
How do you calculate gable stud lengths?
Each stud is its distance from the nearest wall in feet times the unit rise, and neighbors differ by the spacing in feet times the unit rise: at 16 in and 6:12, 16 ÷ 12 = 1.333 and 1.333 × 6 = 8 in, the difference the Navy's Builder Basic lays out with a framing square for the same roof.[1] The first stud goes under the center of the gable.[1]
How do you calculate the angle of a gable roof?
Take the arctangent of the unit rise over 12: atan(6 ÷ 12) = 26.57° at 6:12. The roof pitch calculator converts any pitch to degrees and back.
How many rafters does a gable roof need?
Divide the length in inches by the spacing, round up and add one for each side: 23 + 1 = 24 a side and 2 × 24 = 48 for the worked example, where 30 × 12 ÷ 16 = 22.5 → 23.
How high should a gable roof be?
The height follows from the width and the pitch you choose. The code sets the lowest slope each roof covering may go on, listed on the minimum roof pitch page.
How far can a 2x12 rafter span?
The 2024 IRC sizes rafters from its span tables, by species, grade, spacing and load, with the span measured on the horizontal projection.[2] This site doesn't reproduce those tables; the calculator lays a roof out and sizes nothing.
Methodology & sources
The framing method is the U.S. Navy's Builder Basic (NAVEDTRA 14043A, October 2010), chapter 10, on framing terms, common rafters, gable end studs and gable end overhangs, read on Nov 20, 2026, with the 2024 IRC's limit on sheathing past a gable endwall. The engine is tested on every build against the manual's own examples: common rafters at 7:12 on a 16 ft span and 6:12 on a 25 ft span, and the gable studs' common difference at 6:12, 24 and 16 in on center.[1] The roof area uses the same pitch multiplier as the roof area calculator, and a roofing square is NRCA's 100 sq ft.[3] Drip edge goes at the eaves and the rakes of a shingle roof, so the edges are given for both.[4] The roof flashing calculator turns them into pieces of drip edge.
Assumptions: two planes at one pitch over a rectangular building; heights and lengths on the rafters' theory line, from the top of the wall plate at the outside of the wall; gable studs laid out from the center of the gable at the framing spacing, with no opening; one rafter on each end wall. The calculator sizes no rafters and doesn't cover unequal pitches, hips or valleys; the rafter length calculator gives the cut lengths and the birdsmouth.
Sources
- [1] U.S. Navy, Naval Education and Training Professional Development and Technology Center. Builder Basic, NAVEDTRA 14043A (October 2010), Chapter 10: Rough Carpentry. p. 10-51, p. 10-65, p. 10-70, p. 10-71, p. 10-72, pp. 10-51 and 10-63, pp. 10-51 and 10-73, pp. 10-51 to 10-52 and 10-57, pp. 10-71 to 10-72. Retrieved Nov 20, 2026. media.defense.gov
- [2] International Code Council. 2024 International Residential Code, Chapter 8: Roof-Ceiling Construction (Oct 2026 version). Sections R802.4.1, R803.2.3. Retrieved Nov 20, 2026. codes.iccsafe.org
- [3] National Roofing Contractors Association. Roofing Guidelines glossary: Square. Retrieved Oct 9, 2026. nrca.net
- [4] International Code Council. 2024 International Residential Code, Chapter 9: Roof Assemblies (Oct 2026 version). Section R905.2.8.5. Retrieved Oct 28, 2026. codes.iccsafe.org
Change log: first published November 25, 2026.
Related
- Rafter length calculator
- Roof area calculator
- Roof pitch calculator
- Hip roof calculator
- Roof volume calculator
- Roof truss calculator
- Shingle calculator
- Roof flashing calculator
- Roof sheathing calculator
- Minimum roof pitch
By Marko Visic, BSc Physics. Updated November 25, 2026.