Introduction
A rafter is one of the sloped beams that holds up your roof. It runs from the top ridge of the roof down to the outer wall of your building. When you build or repair a roof, you need to know the exact length of each rafter so you can cut your lumber correctly. This rafter calculator helps you figure out that length quickly and easily. Just enter your roof's span, pitch, or rise and run, and the tool does the math for you. It works for common rafters, hip rafters, and jack rafters. Whether you are a homeowner planning a DIY project or a contractor on a job site, this calculator saves you time and helps you avoid costly cutting mistakes.
How to use our Rafter Calculator
Enter your roof measurements below to find the rafter length, ridge board height, and birdsmouth cut dimensions you need for your project.
Run (Horizontal Distance): Enter the horizontal distance from the outside edge of the wall to the center of the ridge board. This is usually half the total span of the building. Enter this value in feet or inches. If you need help determining the horizontal distance across your building footprint, our square footage calculator can assist with basic area and dimension calculations.
Roof Pitch: Enter the slope of your roof. This is written as a ratio, such as 6/12, which means the roof rises 6 inches for every 12 inches of horizontal run. You can enter this as a fraction or pick from common pitch options. If you need to determine the slope from two known points, a slope calculator can help you understand the relationship between rise and run.
Wall Height: Enter the height of your exterior wall from the top of the foundation to the top plate where the rafter will sit. Enter this value in feet or inches.
Rafter Width: Enter the width of the lumber you plan to use for your rafters. Common sizes include 2x6, 2x8, 2x10, or 2x12. This helps calculate the birdsmouth cut and tail length. When framing your walls to support these rafters, use our stud calculator to determine the correct number and spacing of wall studs.
Eave Overhang: Enter how far you want the rafter tail to extend past the outside edge of the wall. This overhang protects your walls from rain and gives your roof its finished look. Enter this value in inches.
Ridge Board Thickness: Enter the thickness of your ridge board. This is usually 1.5 inches for dimensional lumber. The calculator uses this to adjust the rafter length so everything fits tight at the peak.
What Is a Rafter?
A rafter is a sloped structural board that runs from the ridge (the peak of the roof) down to the top of the exterior wall. Rafters hold up the roof sheathing and shingles, and they carry the weight of the roof down to the walls of the building. Every stick-framed roof relies on rafters cut to the right length and angle so the roof fits together properly.
Key Rafter Measurements You Need to Know
Run is the horizontal distance from the outer edge of the wall to the center of the ridge. For a simple gable roof, the run is usually half the building width minus half the ridge beam thickness. Rise is the vertical distance from the top of the wall to the top of the ridge. Pitch describes how steep the roof is, expressed as inches of rise per 12 inches of run. For example, a 6-in-12 pitch means the roof goes up 6 inches for every 12 inches it goes sideways. These three values are all connected — if you know any two, you can figure out the third. The underlying math is the same principle used in a distance calculator, where two known sides of a right triangle reveal the third.
How Rafter Length Is Calculated
Rafter length is found using the Pythagorean theorem. The run and rise form the two short sides of a right triangle, and the rafter is the long side (the hypotenuse). The formula is:
Rafter Length = √(Run² + Rise²)
A related number called the slope factor makes this easier. The slope factor equals 1 divided by the cosine of the roof angle. Multiply the run by the slope factor, and you get the rafter length along the slope. This same factor applies to the overhang portion of the rafter.
Birdsmouth Cut
The birdsmouth is a notch cut into the rafter where it sits on top of the wall plate. It has two parts: the seat cut, which is a horizontal cut that rests flat on the wall, and the plumb cut, which is a vertical cut that fits snug against the outside of the wall. The birdsmouth keeps the rafter from sliding off the wall and gives it a solid bearing surface. Building codes typically require that no more than one-third of the rafter depth be removed by the birdsmouth.
HAP (Height Above Plate)
HAP stands for Height Above Plate. It is the amount of rafter material that sticks up above the wall plate after the birdsmouth is cut. HAP matters because it determines how much material is left to carry the roof load at the wall. A larger birdsmouth cut means a smaller HAP, which can weaken the rafter at that point.
Overhang and Tail Cut
The overhang is the part of the rafter that extends past the exterior wall. It protects the walls from rain and gives the roof its eave. The overhang is measured horizontally, and its slope length is calculated using the same slope factor as the main rafter. The tail cut at the end of the overhang is a plumb cut made at the same angle as the ridge cut.
Ridge Height
The ridge height is the total distance from the finished floor to the top of the ridge board. It equals the wall height plus the rise. Knowing the ridge height helps you set the ridge board at the correct position before installing rafters.
Common Roof Pitches
Roof pitches typically range from 2-in-12 for low-slope roofs up to 12-in-12 for steep roofs. A 4-in-12 pitch is common on ranch-style homes, while 8-in-12 or steeper is common on traditional and colonial designs. Steeper pitches shed rain and snow faster but require more material and are harder to work on safely. Once you have your rafters set and the roof decked, you can estimate roofing material quantities — for example, our asphalt calculator helps with paving projects, while the insulation calculator is useful when figuring out how much insulation to place between your rafters. For the interior finish below, a drywall calculator can help you estimate ceiling and wall materials, and a paint calculator lets you plan your final coating. If your project also involves a concrete foundation or footings, check out our concrete calculator to estimate the right volume of material.