There is no house without a roof, and to build a roof, you need proper roof trusses - which is exactly the purpose of this roof truss calculator! 🏠

With this tool, you can answer the question of "How many trusses do I need for my house?" in no time. But that's not all! It also gives you the possibility to figure out the rafter length. You can also use it to estimate the roof truss cost, and even include the approximate costs of installation. Read on to find out how to calculate roof truss count and roof truss cost, and learn about roof truss spacing!

How to use the roof truss calculator?

Our tool has two applications. You can use it either as a rafter length calculator, and get the dimensions of your trusses estimated, or as a roof truss count calculator, which will also allow you to estimate the roof truss costs and even includes the price of installation.

To start your calculations, you need to choose from the two options mentioned above. In the field above the illustration, pick either "rafter length" or "truss count".

  1. If you picked rafter length:

Start by deciding what you want your calculations to be based on. You can choose the rise of the roof (which is its height), or the roof pitch (which is the slope created by the rafter). If you want to learn more about the way it's calculated, check out our roof pitch calculator.

  • If you picked the rise, all you need to do is input its value, put in the roof's run, and the calculator will return the rafter length in the bottom-most field.

    Please note that the rafter length calculator works both ways, that is, you can also use it to calculate the rise or the run! If you already know the rafter length and want to figure out any of the other dimensions, simply input the two you know, and you will get the third one.

  • If you decided to include roof pitch to get the rafter length, you will need to input the run and the pitch of the roof. After doing that, you will see the rafter length in the bottom-most field.

    Here as well, our calculator works both ways. You can input any of the three values to get the third one calculated.

    You can input the roof pitch in any of the three formats (angle, percentage, ratio), and our tool will automatically tell you the other ones.

  1. If you picked truss count:
  • Input the roof length, the on-center spacing (the distance between the middles of two neighboring roof trusses), and the roof truss calculator will return the number of roof trusses needed.

  • Our tool can also figure out the approximate roof truss cost. In the next fields of the calculator, decide whether you want to include the costs of installation in the calculations.

    • If you pick No, the only thing left to input is the cost of a single roof truss. The roof truss calculator will return the total expenses in the bottom-most field.

    • If you pick Yes, you will also need to declare how much per unit of time the contractor will charge you to install the trusses, as well as the expected installation duration. As soon as you fill in all the variables, you will see the total expenses at the bottom of the calculator.

Don't worry if you're unsure of what exactly is meant by the roof's run, rise, on-center spacing, etc, we've prepared an illustration them in the calculator.

How to calculate truss count and roof truss cost?

As you know, you can use this tool for more than just figuring out rafter length and other truss dimensions! Our roof truss calculator can also help you plan out your roof project by estimating the truss count, showing you expected cost of the materials, and finding the installation cost. So, to answer the question "How many trusses do I need?", it uses the following equations:

  • truss count = ((roof length * 12)/24) + 1,

Rounded up to the closest whole number (for example if the result is 14.5, you need to get 15 trusses).

To calculate the costs, we use the following two formulas:

Including installation costs:

  • total costs = truss count * single truss price + cost per time unit of work * duration of work

Excluding installation costs:

  • total costs = truss count * single truss price

If you're unsure about the terms such as the on-center spacing, refer to the illustrations below:

Roof truss calcualtor - truss count

Roof truss calculator = truss count
(Image created on the basis of: King post truss 3D created by George Ponderevo, licensed under the Creative Commons Attribution-Share Alike 3.0 Unported licence.)

How to calculate rafter length?

This rafter length calculator lets you calculate roof truss dimensions using two slightly different sets of variables. It all comes down to what information you already have. Usually, that is either the pitch or the rise of the roof. What is more, the formula used to calculate roof truss dimensions is one you probably know very well - it's the exact same formula you use to describe a right triangle - Pythagoras!

The formulas we used are the following:

  1. For calculations based on the roof rise:

rise² + run² = rafter length² ,

Meaning that:

rafter length = √(rise² + run²).

  1. For calculations based on the roof pitch:

The formula used to calculate rafter length from roof pitch is, in fact, the same as the one above. The one difference is that we need to calculate the roof rise using the pitch first. So what you need to do first is to get the pitch, using the following formula:

rise / run = pitch,

Expressed as a percentage, meaning that:

rise = run * pitch.

We can merge these two equations to get a single rafter length formula based on roof pitch:

rafter length² = (run * pitch)² + run²

rafter length = √((run * pitch)² + run²)

rafter length = run * √(pitch² + 1)

If you're unsure about the terms such as roof run and rise, refer to the illustration below:

Roof truss calculator - rafter length
(Image created on the basis of: King post truss 3D created by George Ponderevo, licensed under the Creative Commons Attribution-Share Alike 3.0 Unported licence.)

What is on-center spacing?

One of the values needed by the roof truss calculator is on-center spacing. This is not a very well-know term, but it can prove useful in more contexts than just when discussing rafter length, roof truss cost, and the like. Why don't we spend a minute learning about it?

On-center spacing (often abbreviated into OC or o.c. in construction) is a measure commonly used in architectural designs and construction drawings. It stands for the spacing between the exact centers of two framing members (in this calculator, it indicates the roof truss spacing).

For example, if a plan states that there should be "20 inches OC between fence posts" and those posts are 6 inches wide, this means the space between posts will be about 14 inches (20 - (3 + 3)).

One of the most prominent uses of OC spacing is stud framing. Framed walls tend to be covered by sheet goods, for example plywood or drywall. A single sheet is typically 48 inches wide (size 4' x 8'). Framing a stud wall at 16 or 24 inches OC will result in the edge of a vertical sheet falling over the center of a stud, as 48 is divisible by both 16 and 24. Thanks to this, the edge of the sheet is securely supported and backed by about ¾ inch of wood, which we can use for nailing. Thanks to this, the installation of sheet goods with OC spacing is reliable and relatively simple.

OC spacing is also useful when you use materials that have varying thickness, such as milled lumber, which does not come with precise dimensions. Thanks to using this measure, you can ensure the accuracy of layouts that use such materials.

What kind of roof trusses are available?

If you're using this rafter length calculator, you're probably in the process of building a house, so you might be interested in what kind of trusses there are on the market! When it comes to the different truss types you can use for roof construction, there's plenty to choose from depending on your needs. Here are the four most common ones:

Roof truss calculator: roof truss types

(Image credit:

  1. Fink roof truss - generally the cheapest option. Its main advantage is low weight and the fact that you can build it relatively fast (even as quickly as in one day).
  2. Traditional cut roof - especially useful for complex roof shapes.
  3. Attic truss - this design comes with space that you can use for storage. Unfortunately, they tend to be on the expensive side.
  4. Panelized roofing - best for simple-shaped roofs. It is made out large pre-insulated sheets which are laid across the beams. The materials can be more expensive than in regular trusses, but the simplicity of design reduces installation costs.
Maria Kluziak
I want to calculate...
truss count
Roof truss calculator - truss count calculation (truss count)
Roof truss calculator - truss count calculation (roof length)
Roof length
On-center spacing
Truss count
Include installation costs?
Single truss cost
Total expenses
People also viewed…


Use the baluster calculator to estimate how many balusters you will need for your railing.

Elevation grade

Elevation grade calculator determines the grade or slope of a specific earthen area, given its "rise" and "run".

Test grade

With this test grade calculator you'll easily find out the test percentage score and grade.
main background