{
  "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": "pergola-rafter-spacing-calculator",
  "category": "materials-quantities",
  "title": "Pergola/Trellis Rafter Spacing Calculator",
  "description": "Calculate the number of rafters needed to span a pergola or trellis structure at a given on-center spacing.",
  "url": "https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/",
  "json": "https://craftquantities.com/api/v1/calculators/pergola-rafter-spacing-calculator.json",
  "inputCount": 2,
  "testCaseCount": 2,
  "sourceCount": 1,
  "lastVerified": "2026-09-05",
  "citation": {
    "author": "Craft Quantities",
    "title": "Pergola/Trellis Rafter Spacing Calculator",
    "version": "1.0.1",
    "sourcesChecked": "2026-09-05",
    "url": "https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-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. Pergola/Trellis Rafter Spacing Calculator. Version 1.0.1. Sources checked 2026-09-05. https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/",
      "apa": "Craft Quantities. (2026). Pergola/Trellis Rafter Spacing Calculator (Version 1.0.1) [Web calculator]. Retrieved from https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/",
      "harvard": "Craft Quantities (2026) Pergola/Trellis Rafter Spacing Calculator (Version 1.0.1). Available at: https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/",
      "bibtex": "@misc{craftquantities-calculators-materials-quantities-pergola-rafter-spacing-calculator,\n  author       = {{Craft Quantities}},\n  title        = {Pergola/Trellis Rafter Spacing Calculator},\n  version      = {1.0.1},\n  year         = {2026},\n  howpublished = {\\url{https://craftquantities.com/calculators/materials-quantities/pergola-rafter-spacing-calculator/}},\n}"
    }
  },
  "inputs": [
    {
      "id": "pergolaWidth",
      "label": "Pergola/Trellis Width (Span Direction)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 4,
      "min": 0.01,
      "max": 12,
      "step": 0.1,
      "help": "The overall width of the pergola or trellis in the direction the rafters span across."
    },
    {
      "id": "maxRafterSpacing",
      "label": "Maximum Rafter Spacing (On-Center, per Design)",
      "type": "number",
      "dimension": "length",
      "defaultValue": 0.6,
      "min": 0.01,
      "max": 1.2,
      "step": 0.05,
      "help": "The maximum on-center spacing allowed between rafters per the design or span table."
    }
  ],
  "sources": [
    {
      "label": "Rafter count = ceil(Pergola Width ÷ Maximum Rafter Spacing) + 1 — the standard support-count method (identical in principle to this site's joist/stud spacing calculators) applied to pergola or trellis rafter layout."
    }
  ],
  "testCases": [
    {
      "name": "4m wide pergola, 0.6m max spacing",
      "inputs": {
        "pergolaWidth": 4,
        "maxRafterSpacing": 0.6
      },
      "expected": 8,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Bays across the pergola",
          "value": 7
        },
        {
          "label": "Rafter centres, as laid out",
          "value": 0.5714285714285714,
          "unit": "m"
        }
      ],
      "basis": "sole-source",
      "sourceIndex": 0
    },
    {
      "name": "6m wide pergola, 0.5m max spacing",
      "inputs": {
        "pergolaWidth": 6,
        "maxRafterSpacing": 0.5
      },
      "expected": 13,
      "toleranceDecimalPlaces": 0,
      "unit": "rafters",
      "confidence": "high",
      "steps": [
        {
          "label": "Bays across the pergola",
          "value": 12
        },
        {
          "label": "Rafter centres, as laid out",
          "value": 0.5,
          "unit": "m"
        }
      ],
      "basis": "sole-source",
      "sourceIndex": 0
    }
  ]
}
