# Stair Calculator

> Divides a total floor-to-floor rise into equal risers close to a target riser height, derives the tread count, total run, stringer length and stair angle, and checks the result against the IRC residential limits (riser ≤ 7¾ in / 196 mm, tread ≥ 10 in / 254 mm) and the 2R + T comfort rule.

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

## Purpose

Divides a total floor-to-floor rise into equal risers close to a target riser height, derives the tread count, total run, stringer length and stair angle, and checks the result against the IRC residential limits (riser ≤ 7¾ in / 196 mm, tread ≥ 10 in / 254 mm) and the 2R + T comfort rule.

**Use when:** You are laying out a straight flight of interior or deck stairs and need the number of risers, the exact riser height, the total run and the stringer length.

**Do not use when:** The stair has winders, landings or curves (design each straight flight separately), or you need a roof/rafter slope (use roof-pitch).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `unit_system` | enum: metric \| imperial |  | optional, default "metric" | Unit system of the length inputs (metric: m / cm / mm; imperial: ft / in). Outputs are reported in both systems. |
| `total_rise` | number | cm or in | required | Finished-floor to finished-floor height in centimetres (metric) or inches (imperial). (> 0, max 2000) |
| `ideal_riser_height` | number | cm or in | optional | Preferred riser height; the riser count is total_rise / this value rounded to the nearest whole number. Default 18 cm (metric) or 7 in (imperial). (> 0, max 40) |
| `tread_depth` | number | cm or in | optional | Horizontal depth of each tread, nosing to nosing. Default from the comfort rule: 63 cm − 2 × riser (metric) or 25 in − 2 × riser (imperial). (> 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `risers` | integer |  | round(total_rise / ideal_riser_height), at least 1. |
| `treads` | integer |  | risers − 1 (the upper floor acts as the last tread). |
| `riser_height_cm` | number | cm | total_rise / risers. |
| `riser_height_in` | number | in | Riser height in inches. |
| `tread_depth_cm` | number | cm | Tread depth used. |
| `tread_depth_in` | number | in | Tread depth in inches. |
| `total_run_cm` | number | cm | treads × tread_depth (horizontal length of the flight). |
| `total_run_in` | number | in | Total run in inches. |
| `stringer_length_cm` | number | cm | √(total_rise² + total_run²), the sloped length of the flight. |
| `stringer_length_in` | number | in | Stringer length in inches. |
| `stair_angle_degrees` | number | ° | atan(total_rise / total_run). |
| `comfort_check` | string |  | Whether 2 × riser + tread falls in the 63–65 cm (24–25 in) comfort range. |
| `code_check` | string |  | Comparison with IRC R311.7.5: riser ≤ 7¾ in (196 mm), tread ≥ 10 in (254 mm). |

## Formula

`risers = round(total_rise / ideal_riser_height); riser = total_rise / risers; treads = risers − 1; total_run = treads × tread_depth; stringer = √(total_rise² + total_run²); angle = atan(total_rise / total_run); comfort: 63 cm ≤ 2·riser + tread ≤ 65 cm (24–25 in).`

The 2R + T rule (Blondel, 1675) approximates a natural stride; the IRC limits are the US one- and two-family dwelling maximums (R311.7.5.1–.2), with a 3/8 in (9.5 mm) allowed variation between risers. UK Part K allows risers 150–220 mm and goings ≥ 220 mm for private stairs.

## Data Sources

- 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)
- Wikipedia – Stairs (dimensions and the 2R + T rule) — https://en.wikipedia.org/wiki/Stairs (reference, 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/stairs?total_rise=…`
- `POST https://tttkmbb.com/api/v1/calculate/stairs` 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/stairs · OpenAPI operationId `calculate_stair_dimensions` 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": "stairs", "inputs": {…}}`

## Example

- 106 in rise, 7 in target riser, 10.5 in treads: inputs `{"unit_system":"imperial","total_rise":106,"ideal_riser_height":7,"tread_depth":10.5}` → `{"risers":15,"treads":14,"riser_height_in":7.067,"riser_height_cm":17.95,"total_run_in":147,"stringer_length_in":181.23,"stair_angle_degrees":35.8,"comfort_check":"2R + T = 24.63 in: within the 24–25 in comfort range","code_check":"Meets IRC R311.7.5 (riser 7.07 in ≤ 7.75 in, tread 10.5 in ≥ 10 in)"}`
- 270 cm rise, 18 cm target riser, 27 cm treads: inputs `{"unit_system":"metric","total_rise":270,"ideal_riser_height":18,"tread_depth":27}` → `{"risers":15,"treads":14,"riser_height_cm":18,"riser_height_in":7.087,"total_run_cm":378,"stringer_length_cm":464.5,"stair_angle_degrees":35.54,"comfort_check":"2R + T = 63 cm: within the 63–65 cm comfort range"}`

```
GET https://tttkmbb.com/api/v1/calculate/stairs?unit_system=imperial&total_rise=106&ideal_riser_height=7&tread_depth=10.5
```

## Limitations

The stair has winders, landings or curves (design each straight flight separately), or you need a roof/rafter slope (use roof-pitch). The 2R + T rule (Blondel, 1675) approximates a natural stride; the IRC limits are the US one- and two-family dwelling maximums (R311.7.5.1–.2), with a 3/8 in (9.5 mm) allowed variation between risers. UK Part K allows risers 150–220 mm and goings ≥ 220 mm for private stairs. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the number of treads one less than the risers?**

The top riser lands on the upper floor, which serves as the final walking surface, so a flight with n risers has n − 1 treads (unless the top tread is a separate landing board).

**Which rise do I measure?**

From finished floor to finished floor, including floor coverings on both levels; a 20 mm difference in finish thickness would otherwise create an uneven first or last step.

**Is the IRC check valid outside the USA?**

The limits are from the US residential code. Many other codes are similar but not identical (e.g. UK Part K max riser 220 mm, min going 220 mm), so verify against the local code.

## Related

- [Roof Pitch Calculator](https://tttkmbb.com/construction/roof-pitch.md) — Rise-over-run conversions for roofs.
- [Right Triangle Calculator](https://tttkmbb.com/geometry/right-triangle.md) — Solve the stringer triangle directly.
- [Decking Calculator](https://tttkmbb.com/construction/decking.md) — Deck material for the platform the stairs serve.
