Methodology: How the Calculations Work and Are Tested
The conventions, formulas, unit handling and tests behind every calculator on this site, and the things the tools deliberately do not calculate.
Measurement conventions
- Total rise: lower finished floor (or landing) to upper finished floor, measured where the stair stands.
- Riser height: total rise ÷ number of risers. All risers are equal. This equals the code measurement between leading edges of adjacent treads on a uniform stair.
- Going: horizontal distance nosing to nosing (equivalently riser face to riser face). It excludes the nosing overhang.
- Top of stair: "upper floor is the top step" gives treads = risers − 1; "extra tread level with the floor" gives treads = risers. The chosen convention is printed next to every result.
- Total run: treads × going, bottom riser face to top riser face. The bottom tread's nosing and any landings are extra.
- Pitch: atan(riser ÷ going), the angle of the line through the nosings.
- Pitch-line length: risers × √(riser² + going²). A geometric reference, never presented as a cut length.
- Stringer: treads rest directly on seat cuts; the first riser cut is riser − tread thickness (+ any floor finish added at the bottom later); the top ends in a plumb cut at the face of the top riser. Throat is board width − riser × going ÷ √(riser² + going²). The shortest board is the length of the stringer outline projected onto the board's axis.
- Deck stairs: for each riser count the landing point is treads × going from the deck face; the rise there is deck height + ground slope × landing distance − pad height. The smallest count that keeps the riser at or below the maximum is chosen.
Units and rounding
All geometry is stored in millimetres as double-precision numbers, with 1 in = 25.4 mm exactly. Inputs are converted once, when you type them. Results are rounded only for display: to the nearest 1/16 in by default (1/8 or 1/32 on request), or 0.1 mm. A "≈" mark means a displayed fraction is rounded. Switching between inches and metric re-formats the stored millimetre values and never re-reads a rounded display, so toggling cannot drift the geometry.
Riser counts use a tiny tolerance (10⁻⁹ of the ratio) so that exact divisions such as 105 ÷ 7.5 = 14 are not pushed to 15 by floating-point noise.
Input validation
Zero, negative, non-numeric and absurd inputs are rejected or flagged with an explanation instead of being silently coerced. Examples: a maximum riser typed in the wrong unit (which would need more than 60 risers), a nosing as large as the going, a board too narrow to notch, a tread thicker than the riser, ground steeper than 1 in 1. A rise of one riser or less is shown as a single step with no treads, and the angle is reported as not applicable rather than as NaN.
Informational checks
Calculators compare geometry with reference values from named editions and sections (see sources). Each item is labelled "within reference", "outside reference" or "check". The site never labels a stair as passing, compliant, approved or safe, because that depends on local adoption, amendments, exceptions, the building's use and inspection.
How the engine is tested
The calculation code is separate from the page code and covered by automated tests (Vitest) that run before every build:
- Reference fixtures with expected values derived independently of the code, by hand and with a separate Python script, not by running this engine. The table below is recomputed during every site build; the build fails if any value disagrees.
- Property tests (fast-check) over thousands of random inputs: risers × riser height = total rise; riser ≤ maximum and one fewer riser would exceed it; run = treads × going; tan(angle) = riser ÷ going; no negative or non-finite outputs; stringer marks exactly one step apart; deck risers within the maximum at the actual landing point.
- Parser tests for fractions, feet and inches, Unicode fractions, metric suffixes and rejected inputs, plus round-trip tests for unit conversion.
- Copy tests that re-derive the numbers quoted in the guides and calculator pages.
- Browser tests (Playwright) for the main flows, error states and layout at phone to desktop widths, with automated accessibility scans.
Reference fixtures (computed at build time)
| ID | Case | Quantity | Expected | Engine | Result |
|---|---|---|---|---|---|
| F1 | Typical 9 ft stair rise 108 in, max riser 7 3/4 in, going 10 1/2 in, upper floor is top step | risers | 14 | 14 | matches |
| treads | 13 | 13 | matches | ||
| riser height | 7.7143 in | 7.7143 in | matches | ||
| total run | 136.5000 in | 136.5000 in | matches | ||
| pitch | 36.304 ° | 36.304 ° | matches | ||
| pitch-line length | 182.4089 in | 182.4089 in | matches | ||
| F2 | Exact division (floating-point trap) rise 105 in, max riser 7 1/2 in | risers | 14 | 14 | matches |
| riser height | 7.5000 in | 7.5000 in | matches | ||
| F3 | Metric stair rise 2600 mm, max riser 190 mm, going 250 mm | risers | 14 | 14 | matches |
| riser height | 185.7143 mm | 185.7143 mm | matches | ||
| total run | 3250 mm | 3250 mm | matches | ||
| pitch | 36.607 ° | 36.607 ° | matches | ||
| F4 | Extra top tread convention as F1, tread level with upper floor | treads | 14 | 14 | matches |
| total run | 147 in | 147 in | matches | ||
| F5 | Single step rise 7 in, max riser 7 3/4 in | risers | 1 | 1 | matches |
| treads | 0 | 0 | matches | ||
| total run | 0 in | 0 in | matches | ||
| F6 | On the riser threshold rise 31 in, max riser 7 3/4 in | risers | 4 | 4 | matches |
| riser height | 7.7500 in | 7.7500 in | matches | ||
| F7 | Just over the threshold rise 31.01 in, max riser 7 3/4 in | risers | 5 | 5 | matches |
| riser height | 6.2020 in | 6.2020 in | matches | ||
| F8 | One extra riser as F1 with 15 risers | riser height | 7.2000 in | 7.2000 in | matches |
| total run | 147 in | 147 in | matches | ||
| pitch | 34.439 ° | 34.439 ° | matches | ||
| S1 | Cut stringer on a 2x12 F1 stair, 1 in treads, 11 1/4 in board | first riser cut | 6.7143 in | 6.7143 in | matches |
| step along edge | 13.0292 in | 13.0292 in | matches | ||
| throat | 5.0332 in | 5.0332 in | matches | ||
| shortest board | 168.7876 in | 168.7876 in | matches | ||
| D2 | Deck on falling ground deck 40 in, ground falls 2 in per 8 ft, going 10 1/2 in | risers | 6 | 6 | matches |
| actual rise | 41.0938 in | 41.0938 in | matches | ||
| D3 | Slope adds a riser deck 46 1/2 in, ground falls 2 in per 8 ft | risers | 7 | 7 | matches |
| risers if level | 6 | 6 | matches | ||
| actual rise | 47.8125 in | 47.8125 in | matches | ||
| D4 | Landing pad deck 30 in, level ground, 4 in pad | risers | 4 | 4 | matches |
| riser height | 6.5000 in | 6.5000 in | matches | ||
| A1 | Angles 7 in on 11 in; 108 in rise at 35° | angle | 32.471 ° | 32.471 ° | matches |
| grade | 63.636 % | 63.636 % | matches | ||
| run at 35° | 154.2400 in | 154.2400 in | matches |
What the tools do not calculate
- Structural capacity: stringer spans, lumber grades, fasteners, connections, footings, guard strength.
- Headroom under the floor opening (flagged as a check, not computed).
- Winders, spiral stairs, curved stairs, and multi-flight stairs with landings.
- Housed (routed) stringers, carriage-and-skirt assemblies and other joinery details.
- Local code adoption, amendments and exceptions; permits; inspection.
The tests show the arithmetic matches independent derivations under the stated conventions. They do not show that a stair built from the results is safe or approved; that depends on the build and on local review. No licensed engineer, architect or code official has reviewed this site.
Change history
- 2026-10-24: first release of the stair, stringer, deck and angle engines, with the fixtures above.
Found an error? Please report it; see the corrections policy.