Home › Construction & Home › Roof Pitch Calculator
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).
When to use
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).
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).
Inputs
| Parameter | Type | Unit | Required | Description |
|---|---|---|---|---|
rise | number | no | Vertical rise over the given run (any length unit, same as run). Give rise + run, or angle_degrees. Range: ≥ 0, ≤ 1000000 | |
run | number | 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). Range: > 0, ≤ 1000000 | |
angle_degrees | number | ° | no | Roof angle from horizontal in degrees; used only when rise is not given. Range: ≥ 0 |
horizontal_run_length | number | no | 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). Range: > 0 |
Outputs
| Output | 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. |
Example
3:12 pitch, 5 m horizontal run: {"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: {"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
Machine access
- API:
GET https://tttkmbb.com/api/v1/calculate/roof-pitch(query parameters) orPOSTwith a JSON body{"inputs": {...}} - Schema: https://tttkmbb.com/api/v1/calculators/roof-pitch · Markdown: https://tttkmbb.com/construction/roof-pitch.md · JSON definition: https://tttkmbb.com/construction/roof-pitch.json
- MCP: server
https://tttkmbb.com/mcp, toolrun_calculator with calculator_id="roof-pitch" - OpenAPI operationId:
calculate_roof_pitch - Freshness:
static. Authentication: none. Rate limit: fair use (see rate limits).
Sources
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 calculators
- Right Triangle Calculator — Solve the full rafter triangle from any two values.
- Stair Calculator — Another rise-over-run design calculation.
- Angle Converter — Convert between degrees, radians and gradians.