{
  "id": "roof-truss",
  "version": "2a22d281e590",
  "status": "published",
  "name": "Roof Truss Calculator",
  "question": "How many roof trusses do I need?",
  "summary": "Computes how many gable roof trusses a building needs at a spacing, and each truss’s rise, top chord length with the overhang, bottom chord, and roof angle, from the span and pitch.",
  "category": "construction",
  "subcategory": "roofing",
  "url": "https://www.acalculator.org/construction/roof-truss-calculator",
  "markdown": "https://www.acalculator.org/construction/roof-truss-calculator.md",
  "kind": "function",
  "method": "Trusses = building length ÷ spacing, rounded up, + 1; height = span ÷ 2 × pitch ÷ 12; top chord = (span ÷ 2 + overhang) × √(1 + (pitch ÷ 12)²); bottom chord = span; angle = arctan(pitch ÷ 12).",
  "assumptions": [
    "Common (gable) trusses with the peak in the middle and the same pitch both sides.",
    "Trusses 24 in on center by default; 16 in is the other common spacing (Fonthill Lumber, a truss maker).",
    "The overhang is measured level from the wall; chord lengths are along the outside line of the roof, before any cut at the peak or the tail."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "l": {
        "title": "Building length",
        "description": "The length of the roof along the ridge, end wall to end wall.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.1,
        "maximum": 1000
      },
      "span": {
        "title": "Span",
        "description": "The width of the building the trusses cross, outside wall to outside wall.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.1,
        "maximum": 100
      },
      "pitch": {
        "title": "Roof pitch (rise per 12)",
        "description": "How many inches the roof rises for every 12 inches across: 6 means a 6/12 pitch.",
        "type": "number",
        "minimum": 0.25,
        "maximum": 24
      },
      "oh": {
        "title": "Overhang",
        "description": "How far the roof sticks out past each wall, measured level. 0 for none.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0,
        "maximum": 10
      },
      "oc": {
        "title": "Truss spacing",
        "description": "The distance from the centre of one truss to the next, usually 24 in or 16 in.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.1,
        "maximum": 10
      },
      "price": {
        "title": "Price per truss",
        "description": "What one truss costs. Leave empty to skip the cost.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000
      }
    }
  },
  "outputs": {
    "count": {
      "label": "Trusses",
      "description": "Building length ÷ spacing, rounded up, plus 1 for the truss at the far end.",
      "format": "integer"
    },
    "rise": {
      "label": "Truss height (ft)",
      "description": "Half the span × pitch ÷ 12: the height of the peak above the walls, in feet.",
      "format": "number"
    },
    "top": {
      "label": "Top chord with overhang (ft)",
      "description": "One sloped side, from the peak to the end of the overhang, in feet.",
      "format": "number"
    },
    "bottom": {
      "label": "Bottom chord (ft)",
      "description": "The span, in feet.",
      "format": "number"
    },
    "riseM": {
      "label": "Truss height (m)",
      "description": "The truss height in metres.",
      "format": "number"
    },
    "topM": {
      "label": "Top chord with overhang (m)",
      "description": "One sloped side in metres.",
      "format": "number"
    },
    "bottomM": {
      "label": "Bottom chord (m)",
      "description": "The span in metres.",
      "format": "number"
    },
    "angle": {
      "label": "Roof angle",
      "description": "The slope of the roof in degrees: arctan(pitch ÷ 12).",
      "format": "number"
    },
    "chords": {
      "label": "Chord length in all trusses (ft)",
      "description": "Trusses × (2 top chords + 1 bottom chord), in feet.",
      "format": "number"
    },
    "cost": {
      "label": "Cost of the trusses",
      "description": "Trusses × the price per truss.",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "l": 9.144,
      "span": 7.315200000000001,
      "pitch": 6,
      "oh": 0.3048,
      "oc": 0.6095999999999999
    },
    "outputs": {
      "count": 16,
      "rise": 6,
      "top": 14.534441853748632,
      "bottom": 24,
      "riseM": 1.8288,
      "topM": 4.430097877022583,
      "bottomM": 7.3152,
      "angle": 26.56505117707799,
      "chords": 849.1021393199562
    },
    "text": "You need 16 trusses, each 6 ft high with a 14.53 ft top chord."
  },
  "examples": [
    {
      "given": {
        "l": 9.144,
        "span": 7.315200000000001,
        "pitch": 6,
        "oh": 0.3048,
        "oc": 0.6095999999999999,
        "price": 150
      },
      "expect": {
        "count": 16,
        "rise": 6,
        "top": 14.534441853748634,
        "bottom": 24,
        "angle": 26.56505117707799,
        "cost": 2400
      },
      "source": "Fonthill Lumber, Roof Truss Spacing Guide (trusses 16 or 24 in on center), https://fonthilllumber.ca/roof-truss-spacing-explained-for-ontario-builders.html; Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3, https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem); hand calculation in content.mdx: 30 ÷ 2 + 1 = 16; 12 × 6/12 = 6 ft; 13 × √1.25 = 14.53 ft"
    },
    {
      "given": {
        "l": 12.192,
        "span": 9.7536,
        "pitch": 9,
        "oh": 0,
        "oc": 0.4064
      },
      "expect": {
        "count": 31,
        "rise": 12,
        "top": 20,
        "chords": 2232
      },
      "source": "Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3, https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem): 12-16-20 right triangle; hand calculation in content.mdx: 480 in ÷ 16 = 30, + 1 = 31"
    },
    {
      "given": {
        "l": 10,
        "span": 8,
        "pitch": 6,
        "oh": 0.5,
        "oc": 0.6
      },
      "expect": {
        "count": 18,
        "riseM": 2,
        "topM": 5.031152949374527,
        "bottomM": 8
      },
      "source": "Pythagorean theorem (OpenStax, Prealgebra 2e, §9.3, https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem); hand calculation in content.mdx: 10 ÷ 0.6 = 16.67 → 17, + 1 = 18; 4.5 × √1.25 = 5.03 m"
    }
  ],
  "sources": [
    "Fonthill Lumber, Roof Truss Spacing Guide for Ontario Builders (a custom truss manufacturer; residential trusses 16 in or 24 in on center, 12 in for high loads). https://fonthilllumber.ca/roof-truss-spacing-explained-for-ontario-builders.html (retrieved 2026-10-02)",
    "OpenStax, Prealgebra 2e, §9.3 Use Properties of Angles, Triangles, and the Pythagorean Theorem (a² + b² = c²). https://openstax.org/books/prealgebra-2e/pages/9-3-use-properties-of-angles-triangles-and-the-pythagorean-theorem (retrieved 2026-10-02)",
    "NIST Handbook 44 (2026), Appendix C, General Tables of Units of Measurement: 1 ft = 12 in = 0.3048 m. https://www.nist.gov/document/2026-nist-handbook-44-appendix-c (retrieved 2026-10-01)"
  ],
  "related": [
    "roof-pitch",
    "roofing",
    "square-footage",
    "board-foot"
  ],
  "changelog": []
}
