{
  "version": "v1",
  "source": "https://craftquantities.com",
  "licence": "CC BY 4.0",
  "licenceUrl": "https://creativecommons.org/licenses/by/4.0/",
  "attribution": "Craft Quantities — craftquantities.com",
  "documentation": "https://craftquantities.com/api/",
  "versioning": "Fields are added, never removed or repurposed, within a version. A breaking change becomes /api/v2/ and v1 keeps being built.",
  "slug": "rafter-quantity-calculator",
  "category": "materials-quantities",
  "title": "Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board)",
  "description": "Count the rafters of a gable, hip or shed roof at your spacing and their lengths, with the hips, jacks, a wing's valley rafters and the ridge board.",
  "url": "https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/",
  "json": "https://craftquantities.com/api/v1/calculators/rafter-quantity-calculator.json",
  "inputCount": 12,
  "testCaseCount": 6,
  "sourceCount": 5,
  "lastVerified": "2026-10-10",
  "citation": {
    "author": "Craft Quantities",
    "title": "Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board)",
    "version": "1.0.0",
    "sourcesChecked": "2026-10-10",
    "url": "https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/",
    "accessDate": null,
    "accessDateNote": "Add the date you retrieved this. It is deliberately absent: a static file cannot know when you read it, and the build date would be wrong.",
    "permanentVersionedUrl": null,
    "permanentVersionedUrlNote": "Not offered. This site keeps no archive of previous builds, so any such URL would resolve to the current page or to nothing. The version and sourcesChecked fields identify the calculation instead.",
    "formats": {
      "plain": "Craft Quantities. Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board). Version 1.0.0. Sources checked 2026-10-10. https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/",
      "apa": "Craft Quantities. (2026). Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board) (Version 1.0.0) [Web calculator]. Retrieved from https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/",
      "harvard": "Craft Quantities (2026) Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board) (Version 1.0.0). Available at: https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/",
      "bibtex": "@misc{craftquantities-calculators-materials-quantities-rafter-quantity-calculator,\n  author       = {{Craft Quantities}},\n  title        = {Rafter Quantity Calculator (Gable, Hip, Shed, L- and T-Shaped Roofs: Rafters, Hips, Valleys, Jacks and Ridge Board)},\n  version      = {1.0.0},\n  year         = {2026},\n  howpublished = {\\url{https://craftquantities.com/calculators/materials-quantities/rafter-quantity-calculator/}},\n}"
    }
  },
  "inputs": [
    {
      "id": "roofShape",
      "label": "Roof Shape",
      "type": "select",
      "defaultValue": "gable",
      "options": [
        {
          "value": "gable",
          "label": "Gable: two slopes, a gable wall at each end"
        },
        {
          "value": "hip",
          "label": "Hip: four slopes, eaves all round"
        },
        {
          "value": "shed",
          "label": "Shed: one slope, high wall to low wall"
        }
      ],
      "help": "Two slopes and gable ends, four slopes with hips, or a single slope."
    },
    {
      "id": "buildingLength",
      "label": "Building Length (along the ridge)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 10,
      "min": 0.5,
      "max": 100,
      "step": 0.1,
      "help": "From one gable wall's outside face to the other's."
    },
    {
      "id": "buildingWidth",
      "label": "Building Width (the span)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 8,
      "min": 0.5,
      "max": 30,
      "step": 0.1,
      "help": "From the outside of one eave wall's plate to the outside of the other."
    },
    {
      "id": "roofPitch",
      "label": "Roof Pitch (rise per 12 run)",
      "type": "number",
      "defaultValue": 6,
      "min": 1,
      "max": 24,
      "step": 0.5,
      "help": "The rise for every 12 of horizontal run, both slopes the same."
    },
    {
      "id": "eaveOverhang",
      "label": "Eave Overhang (in plan)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0.4,
      "min": 0,
      "max": 1.5,
      "step": 0.01,
      "help": "How far the rafter tail reaches past the wall plate, measured level."
    },
    {
      "id": "rakeOverhang",
      "label": "Gable Overhang (each end)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0.3,
      "min": 0,
      "max": 1.5,
      "step": 0.01,
      "help": "How far the roof runs past each gable wall."
    },
    {
      "id": "wing1Span",
      "label": "First Wing's Span (0 for none)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0,
      "min": 0,
      "max": 30,
      "step": 0.1,
      "help": "The width between a wing's eave walls, for an L, T or U-shaped house; 0 for none."
    },
    {
      "id": "wing1Projection",
      "label": "First Wing's Length (0 for none)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0,
      "min": 0,
      "max": 40,
      "step": 0.1,
      "help": "From the main roof's wall line out to the wing's end wall."
    },
    {
      "id": "wing2Span",
      "label": "Second Wing's Span (0 for none)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0,
      "min": 0,
      "max": 30,
      "step": 0.1,
      "help": "A second wing's span, on the same long side for a U or the other for a T; 0 for none."
    },
    {
      "id": "wing2Projection",
      "label": "Second Wing's Length (0 for none)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0,
      "min": 0,
      "max": 40,
      "step": 0.1,
      "help": "A second wing's length; 0 for none."
    },
    {
      "id": "spacing",
      "label": "Rafter Spacing (on centre)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0.6,
      "min": 0.2,
      "max": 1.2,
      "step": 0.001,
      "help": "The centres your span table or framing plan gives."
    },
    {
      "id": "ridgeThickness",
      "label": "Ridge Board Thickness",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0.038,
      "min": 0,
      "max": 0.3,
      "step": 0.0005,
      "help": "Half of it comes off each rafter's run, where the rafter meets the board's face."
    }
  ],
  "sources": [
    {
      "label": "California Residential Code (2025) § R802.3: a ridge board connecting opposing rafters not less than 1 inch (25 mm) nominal thickness and not less in depth than the cut end of the rafter; § R802.4.2: rafters framed opposite each other to a ridge board, offset no more than 1 1/2 inches (38 mm); § R802.4.6: collar ties not less than 1 x 4 nominal, no more than 4 feet (1219 mm) on centre",
      "url": "https://gocodebook.com/library/us/ca/ca-residential-code/chapter-8-roof-ceiling-construction/section-r802-wood-roof-framing"
    },
    {
      "label": "Rafter line length: run x sqrt(1 + (rise / 12)^2), the run being horizontal from the outside of the wall plate to the ridge; the overhang's horizontal projection takes the same factor (this site's common gable rafter length page)"
    },
    {
      "label": "Open Exam Prep, Louisiana roofing contractor guide, 3.2 Surface Area Calculations: the hip and valley multiplier sqrt(12² + 12² + R²) / 12 from the 17-inch diagonal run (1.500 at 6:12); length of one hip rafter = common run x the hip multiplier",
      "url": "https://open-exam-prep.com/study-guides/la-roofing-contractor/roofing-estimating-plan-reading-math/surface-area-calculations-squares"
    },
    {
      "label": "Jack rafters on an equal-pitch 45° hip: each spacing along the plate shortens a jack by the spacing x the common rafter's length per unit of run, the framing square's common difference (this site's hip and valley rafter cut list page)"
    },
    {
      "label": "Southern Pine Inspection Bureau, \"Nominal vs. Actual Lumber Sizes\": dressed sizes per PS 20-20, the American Softwood Lumber Standard; a nominal 2-inch member dresses to 1 1/2 in",
      "url": "https://blog.spib.org/nominal-vs-actual-lumber-sizes/"
    }
  ],
  "testCases": [
    {
      "name": "Opening: a 10 x 8 m gable at 6 in 12, 400 mm eaves, 300 mm gable overhangs, rafters at 600 mm, 38 mm ridge",
      "inputs": {
        "buildingLength": 10,
        "buildingWidth": 8,
        "roofPitch": 6,
        "eaveOverhang": 0.4,
        "rakeOverhang": 0.3,
        "spacing": 0.6,
        "ridgeThickness": 0.038
      },
      "expected": 40,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Common rafters, both slopes",
          "value": 36,
          "unit": "rafters"
        },
        {
          "label": "Barge rafters at the gable overhangs",
          "value": 4,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.118033988749895
        },
        {
          "label": "Length of each rafter, ridge face to tail",
          "value": 4.8981069047132895,
          "unit": "m"
        },
        {
          "label": "Rafters, lineal",
          "value": 195.92427618853156,
          "unit": "m"
        },
        {
          "label": "Ridge board length",
          "value": 10.6,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 0
    },
    {
      "name": "A 40 x 28 ft gable at 8 in 12, 16 in eaves, flush gables, rafters at 16 in, 1 1/2 in ridge",
      "inputs": {
        "buildingLength": 12.192,
        "buildingWidth": 8.5344,
        "roofPitch": 8,
        "eaveOverhang": 0.4064,
        "rakeOverhang": 0,
        "spacing": 0.4064,
        "ridgeThickness": 0.038099999999999995
      },
      "expected": 62,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Common rafters, both slopes",
          "value": 62,
          "unit": "rafters"
        },
        {
          "label": "Barge rafters at the gable overhangs",
          "value": 0,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.2018504251546631
        },
        {
          "label": "Length of each rafter, ridge face to tail",
          "value": 5.594072896403636,
          "unit": "m"
        },
        {
          "label": "Rafters, lineal",
          "value": 346.83251957702544,
          "unit": "m"
        },
        {
          "label": "Ridge board length",
          "value": 12.192,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 0
    },
    {
      "name": "A 12 x 8 m hip roof at 6 in 12, 400 mm eaves, rafters at 600 mm, 38 mm ridge",
      "inputs": {
        "roofShape": "hip",
        "buildingLength": 12,
        "buildingWidth": 8,
        "roofPitch": 6,
        "eaveOverhang": 0.4,
        "rakeOverhang": 0.3,
        "spacing": 0.6,
        "ridgeThickness": 0.038
      },
      "expected": 70,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Common rafters along the ridge",
          "value": 16,
          "unit": "rafters"
        },
        {
          "label": "King commons at the hip ends",
          "value": 2,
          "unit": "rafters"
        },
        {
          "label": "Hip rafters",
          "value": 4,
          "unit": "rafters"
        },
        {
          "label": "Jack rafters",
          "value": 48,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.118033988749895
        },
        {
          "label": "Length of each common rafter, ridge face to tail",
          "value": 4.8981069047132895,
          "unit": "m"
        },
        {
          "label": "Length of each hip, ridge to tail",
          "value": 6.6000000000000005,
          "unit": "m"
        },
        {
          "label": "Commons, lineal",
          "value": 88.1659242848392,
          "unit": "m"
        },
        {
          "label": "Hips, lineal",
          "value": 26.400000000000002,
          "unit": "m"
        },
        {
          "label": "Jacks, lineal",
          "value": 134.1640786499874,
          "unit": "m"
        },
        {
          "label": "Ridge board length",
          "value": 4,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 2
    },
    {
      "name": "A 40 x 28 ft hip roof at 8 in 12, 16 in eaves, rafters at 16 in, 1 1/2 in ridge",
      "inputs": {
        "roofShape": "hip",
        "buildingLength": 12.192,
        "buildingWidth": 8.5344,
        "roofPitch": 8,
        "eaveOverhang": 0.4064,
        "rakeOverhang": 0,
        "spacing": 0.4064,
        "ridgeThickness": 0.038099999999999995
      },
      "expected": 106,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Common rafters along the ridge",
          "value": 20,
          "unit": "rafters"
        },
        {
          "label": "King commons at the hip ends",
          "value": 2,
          "unit": "rafters"
        },
        {
          "label": "Hip rafters",
          "value": 4,
          "unit": "rafters"
        },
        {
          "label": "Jack rafters",
          "value": 80,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.2018504251546631
        },
        {
          "label": "Length of each common rafter, ridge face to tail",
          "value": 5.594072896403636,
          "unit": "m"
        },
        {
          "label": "Length of each hip, ridge to tail",
          "value": 7.307042365036927,
          "unit": "m"
        },
        {
          "label": "Commons, lineal",
          "value": 123.06960372088,
          "unit": "m"
        },
        {
          "label": "Hips, lineal",
          "value": 29.228169460147708,
          "unit": "m"
        },
        {
          "label": "Jacks, lineal",
          "value": 253.98464664708465,
          "unit": "m"
        },
        {
          "label": "Ridge board length",
          "value": 3.6576000000000004,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 2
    },
    {
      "name": "A 6 m shed roof over a 3 m span at 3 in 12, 300 mm eaves, flush ends, rafters at 600 mm",
      "inputs": {
        "roofShape": "shed",
        "buildingLength": 6,
        "buildingWidth": 3,
        "roofPitch": 3,
        "eaveOverhang": 0.3,
        "rakeOverhang": 0,
        "spacing": 0.6,
        "ridgeThickness": 0.038
      },
      "expected": 11,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Rafters across the slope",
          "value": 11,
          "unit": "rafters"
        },
        {
          "label": "Barge rafters at the overhanging ends",
          "value": 0,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.0307764064044151
        },
        {
          "label": "Length of each rafter, tail to tail",
          "value": 3.710795063055895,
          "unit": "m"
        },
        {
          "label": "Rafters, lineal",
          "value": 40.818745693614844,
          "unit": "m"
        },
        {
          "label": "Rise across the span, low plate to high plate",
          "value": 0.75,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 1
    },
    {
      "name": "An L: a 12 x 8 m gable with a 6 m wing standing 4 m out, 6 in 12, 400 mm eaves, 300 mm gable overhangs, 600 mm, 38 mm ridge",
      "inputs": {
        "roofShape": "gable",
        "buildingLength": 12,
        "buildingWidth": 8,
        "roofPitch": 6,
        "eaveOverhang": 0.4,
        "rakeOverhang": 0.3,
        "spacing": 0.6,
        "ridgeThickness": 0.038,
        "wing1Span": 6,
        "wing1Projection": 4,
        "wing2Span": 0,
        "wing2Projection": 0
      },
      "expected": 74,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Common rafters, both slopes",
          "value": 42,
          "unit": "rafters"
        },
        {
          "label": "Barge rafters at the gable overhangs",
          "value": 4,
          "unit": "rafters"
        },
        {
          "label": "Slope factor",
          "value": 1.118033988749895
        },
        {
          "label": "Length of each rafter, ridge face to tail",
          "value": 4.8981069047132895,
          "unit": "m"
        },
        {
          "label": "Rafters, lineal",
          "value": 225.31291761681132,
          "unit": "m"
        },
        {
          "label": "Ridge board length",
          "value": 12.6,
          "unit": "m"
        },
        {
          "label": "Main-roof commons the valley jacks replace",
          "value": 9,
          "unit": "rafters"
        },
        {
          "label": "Valley jacks on the main roof",
          "value": 9,
          "unit": "rafters"
        },
        {
          "label": "Valley rafters",
          "value": 2,
          "unit": "rafters"
        },
        {
          "label": "Valley jacks on the wings",
          "value": 8,
          "unit": "rafters"
        },
        {
          "label": "Commons on the wings",
          "value": 16,
          "unit": "rafters"
        },
        {
          "label": "Barge rafters at the wing gables",
          "value": 2,
          "unit": "rafters"
        },
        {
          "label": "Main-roof commons replaced, lineal",
          "value": 44.0829621424196,
          "unit": "m"
        },
        {
          "label": "Valley rafters, lineal",
          "value": 10.2,
          "unit": "m"
        },
        {
          "label": "Valley jacks, lineal",
          "value": 36.53399665038032,
          "unit": "m"
        },
        {
          "label": "Wing commons, lineal",
          "value": 68.0413124873411,
          "unit": "m"
        },
        {
          "label": "Wing ridge boards, lineal",
          "value": 7.3,
          "unit": "m"
        }
      ],
      "basis": "cited",
      "sourceIndex": 2
    }
  ],
  "usedByAssemblies": [
    {
      "id": "asphalt-shingle-roof",
      "name": "Asphalt shingle roof"
    }
  ]
}
