# Roof Pitch Calculator

> Converts a roof slope given as rise and run, or as an angle, into the pitch expressed in rise per 12 units of run, the angle in degrees, the slope in percent and the rafter length multiplier (rafter length per unit of horizontal run).

- Calculator id: `roof-pitch` · Category: Construction & Home (`construction`) · Tool name: `calculate_roof_pitch`
- Canonical page: https://tttkmbb.com/construction/roof-pitch · This document: https://tttkmbb.com/construction/roof-pitch.md · JSON definition: https://tttkmbb.com/construction/roof-pitch.json

## Purpose

Converts a roof slope given as rise and run, or as an angle, into the pitch expressed in rise per 12 units of run, the angle in degrees, the slope in percent and the rafter length multiplier (rafter length per unit of horizontal run).

**Use when:** You need to convert between roof pitch notations (x:12, degrees, percent) or estimate rafter length from the horizontal run.

**Do not use when:** You need a general right-triangle solution with all sides (use right-triangle) or a plain angle unit conversion (use angle).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `rise` | number |  | optional | Vertical rise over the given run (any length unit, same as run). Give rise + run, or angle_degrees. (min 0, max 1000000) |
| `run` | number |  | optional, default 12 | Horizontal run over which the rise is measured (same unit as rise). With the default 12, rise is directly the pitch numerator (e.g. 4 → 4:12). (> 0, max 1000000) |
| `angle_degrees` | number | ° | optional | Roof angle from horizontal in degrees; used only when rise is not given. (min 0) |
| `horizontal_run_length` | number |  | optional | Optional horizontal distance the rafter spans (e.g. half the building width for a gable roof), any unit; returns the rafter length in the same unit (excluding overhang). (> 0) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `pitch_per_12` | number |  | Rise for 12 units of run (US pitch notation). |
| `pitch` | string |  | Pitch written as rise:12. |
| `angle_degrees` | number | ° | atan(rise / run) in degrees. |
| `slope_percent` | number | % | 100 × rise / run. |
| `rafter_multiplier` | number |  | √(rise² + run²) / run = 1 / cos(angle); multiply the horizontal run by this to get the rafter length. |
| `rafter_length` | number |  | horizontal_run_length × rafter_multiplier (same unit as horizontal_run_length); only when given. |

## Formula

`pitch_per_12 = 12 × rise / run; angle = atan(rise / run); slope_percent = 100 × rise / run; rafter_multiplier = √(1 + (rise/run)²); rafter_length = horizontal_run_length × rafter_multiplier. From an angle: rise/run = tan(angle).`

## Data Sources

- Wikipedia – Roof pitch — https://en.wikipedia.org/wiki/Roof_pitch (reference, retrieved 2026-09-23)
- ICC – 2021 International Residential Code, Chapter 3 Building Planning (R311.7 Stairways) — https://codes.iccsafe.org/content/IRC2021P2/chapter-3-building-planning (standard, retrieved 2026-09-23)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/roof-pitch?`
- `POST https://tttkmbb.com/api/v1/calculate/roof-pitch` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/roof-pitch · OpenAPI operationId `calculate_roof_pitch` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "roof-pitch", "inputs": {…}}`

## Example

- 3:12 pitch, 5 m horizontal run: inputs `{"rise":3,"run":12,"horizontal_run_length":5}` → `{"pitch_per_12":3,"pitch":"3:12","angle_degrees":14.04,"slope_percent":25,"rafter_multiplier":1.0308,"rafter_length":5.154}`
- 30° roof: inputs `{"angle_degrees":30}` → `{"pitch_per_12":6.93,"pitch":"6.93:12","angle_degrees":30,"slope_percent":57.74,"rafter_multiplier":1.1547}`

```
GET https://tttkmbb.com/api/v1/calculate/roof-pitch?rise=3&run=12&horizontal_run_length=5
```

## Limitations

You need a general right-triangle solution with all sides (use right-triangle) or a plain angle unit conversion (use angle). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**What is a 4:12 pitch in degrees?**

atan(4/12) = 18.43°, a slope of 33.3 %. Pitches below 2:12 (9.5°) are considered low-slope and usually need membrane rather than shingle roofing.

**Is pitch the same as slope?**

In US practice 'pitch' means rise per 12 in of run (e.g. 6:12); historically pitch was rise over the full span (6:12 = 1/4 pitch). Slope in percent is 100 × rise/run.

**Does rafter_length include the overhang or the ridge board?**

No. It is the sloped length over the horizontal run you enter; add the eave overhang and subtract half the ridge-board thickness when cutting rafters.

## Related

- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve the full rafter triangle from any two values.
- [Stair Calculator](https://tttkmbb.com/construction/stairs.md) — Another rise-over-run design calculation.
- [Angle Converter](https://tttkmbb.com/conversion/angle.md) — Convert between degrees, radians and gradians.
