{
  "id": "roof-pitch",
  "version": "8febc55ea8dd",
  "status": "published",
  "name": "Roof Pitch Calculator",
  "question": "What is my roof pitch?",
  "summary": "Computes a roof’s pitch as rise in 12, its angle, its percent slope, the rafter length and the slope factor, from the rise and run, from a pitch, or from an angle.",
  "category": "construction",
  "url": "https://www.acalculator.org/construction/roof-pitch-calculator",
  "markdown": "https://www.acalculator.org/construction/roof-pitch-calculator.md",
  "kind": "function",
  "method": "slope = rise ÷ run (or pitch ÷ 12, or tan angle); pitch = 12 × slope; angle = arctan(slope); percent = 100 × slope; rafter = run × √(1 + slope²)",
  "assumptions": [
    "The run is the horizontal distance, not the sloped length. For a simple gable it is half the building’s width.",
    "The rafter length is the line from the wall plate to the ridge over the run. It adds nothing for overhang, ridge board thickness or cuts."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "know": {
        "title": "I know",
        "description": "Whether you know the rise and run, the pitch, or the angle.",
        "type": "string",
        "enum": [
          "rise-run",
          "pitch",
          "angle"
        ]
      },
      "rise": {
        "title": "Rise",
        "description": "How far the roof goes up over the run.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0,
        "maximum": 10000
      },
      "run": {
        "title": "Run",
        "description": "The horizontal distance the roof covers, from the wall to below the ridge.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "length",
        "minimum": 0.001,
        "maximum": 10000
      },
      "pitch": {
        "title": "Pitch (rise in 12)",
        "description": "The rise for every 12 units of run, such as 6 for a 6/12 roof.",
        "type": "number",
        "minimum": 0,
        "maximum": 1000
      },
      "angle": {
        "title": "Angle",
        "description": "The angle of the roof above horizontal.",
        "type": [
          "number",
          "string"
        ],
        "x-quantity": "angle",
        "minimum": 0,
        "exclusiveMaximum": 1.5707963267948966
      }
    }
  },
  "outputs": {
    "pitch": {
      "label": "Pitch",
      "description": "The rise for every 12 units of run: 12 × rise ÷ run.",
      "format": "number"
    },
    "angle": {
      "label": "Angle",
      "description": "The angle above horizontal: arctan(rise ÷ run).",
      "format": "quantity",
      "unit": "deg"
    },
    "grade": {
      "label": "Slope",
      "description": "The rise as a percent of the run.",
      "format": "percent"
    },
    "rise": {
      "label": "Rise",
      "description": "The rise over the run: run × rise ÷ run.",
      "format": "quantity",
      "unit": "ft"
    },
    "rafter": {
      "label": "Rafter length",
      "description": "The sloped length over the run: √(rise² + run²), before any overhang.",
      "format": "quantity",
      "unit": "ft"
    },
    "factor": {
      "label": "Slope factor",
      "description": "The rafter length for each unit of run: √(1 + (rise ÷ run)²). Multiply a plan area by it for the roof area.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "know": "rise-run",
      "rise": 1.8288000000000002,
      "run": 3.6576000000000004,
      "pitch": 6,
      "angle": 0.5235987755982988
    },
    "outputs": {
      "pitch": 6,
      "angle": 0.4636476090008061,
      "grade": 50,
      "rise": 1.8288000000000002,
      "rafter": 4.089321117251616,
      "factor": 1.118033988749895
    },
    "text": "The roof pitch is 6 in 12, an angle of 26.57°."
  },
  "examples": [
    {
      "given": {
        "know": "rise-run",
        "rise": 1.8288000000000002,
        "run": 3.6576000000000004
      },
      "expect": {
        "pitch": 6,
        "angle": 0.4636476090008061,
        "grade": 50,
        "rafter": 4.0893211172516155,
        "factor": 1.118033988749895
      },
      "source": "hand calculation in content.mdx: 12 × 6 ÷ 12 = 6; arctan(0.5) = 26.57°; √(6² + 12²) = 13.416 ft; √1.25 = 1.1180"
    },
    {
      "given": {
        "know": "rise-run",
        "rise": 1.3716000000000002,
        "run": 4.572
      },
      "expect": {
        "pitch": 3.6,
        "grade": 30,
        "angle": 0.2914567944778671
      },
      "source": "hand calculation in content.mdx: 12 × 4.5 ÷ 15 = 3.6; 30%; arctan(0.3) = 16.70°"
    },
    {
      "given": {
        "know": "pitch",
        "pitch": 2,
        "run": 3.048
      },
      "expect": {
        "grade": 16.666666666666664,
        "rise": 0.508,
        "angle": 0.16514867741462683
      },
      "source": "IRC 2021 R905.2.2 gives 2:12 as the minimum slope for asphalt shingles; hand calculation in content.mdx: 2 ÷ 12 = 16.67%, arctan(1/6) = 9.46°, rise 10 × 2/12 = 1.667 ft"
    },
    {
      "given": {
        "know": "angle",
        "angle": 0.7853981633974483,
        "run": 2.4384
      },
      "expect": {
        "pitch": 12,
        "rise": 2.4384,
        "factor": 1.4142135623730951
      },
      "source": "hand calculation in content.mdx: tan 45° = 1, so the pitch is 12/12, the rise equals the run, and the factor is √2",
      "tolerance": 1e-12
    }
  ],
  "sources": [
    "International Code Council, International Residential Code 2021, R905.2.2 Slope: asphalt shingles on slopes of 2 units vertical in 12 units horizontal or greater. https://codes.iccsafe.org/s/IRC2021P3/chapter-9-roof-assemblies/IRC2021P3-Pt03-Ch09-SecR905.2.2"
  ],
  "related": [
    "stair",
    "square-footage"
  ],
  "changelog": []
}
