Measuring

Stair Math Calculator: The Formulas Behind Every Step

A stair math calculator applies a small set of geometry formulas — division for step count, trigonometry for angle, and the Pythagorean theorem for stringer length — to turn a single floor-to-floor height into a full staircase layout. None of the underlying maths is advanced; the value of the calculator is doing it consistently and flagging when a result falls outside comfortable or code-legal ranges. Below is every formula spelled out, with a worked example in both US and UK units.

Start with the numbers: our stair runner calculator also works as a stair runner length calculator, adding nosing wrap, landings, winders, pattern repeat and waste so you order the right length first time.

By Eleanor Hartley, Interiors writer · · 7 min read

Last updated · Reviewed by James Whitfield, Stair runner fitter and flooring estimator

Stair Math Calculator: The Formulas Behind Every Step — measuring tread, riser and nosing on a flight of stairs

The core formulas, one at a time

Everything starts from total rise (TR), the vertical floor-to-floor distance. From there: number of steps (N) = TR divided by a target riser height, rounded to the nearest whole number. Actual riser height (R) = TR divided by N, so the risers come out perfectly equal. Tread depth or going (G) is chosen to meet code and comfort rather than calculated from TR. Total run = G times (N minus 1), because the top tread is the upper floor itself, not an extra step.

FormulaWhat it solves
N = round(TR / target riser)Number of steps in the flight
R = TR / NExact riser height once N is fixed
Total run = G x (N - 1)Horizontal space the flight occupies
Stringer length = sqrt(Total run^2 + TR^2)Diagonal length of the notched stringer board
Angle = arctan(TR / Total run)Steepness of the staircase in degrees
Headroom check = ceiling height above the nosing line, measured verticallyWhether a person can walk upright at every point on the stairs

Worked example — US units

Total rise: 108 in. Target riser: 7.25 in. N = 108 / 7.25 = 14.9, round to 15 steps. Actual riser R = 108 / 15 = 7.2 in, comfortably under the 7.75 in code maximum. Choose tread depth G = 10.5 in, satisfying the 10 in code minimum. Total run = 10.5 x 14 = 147 in (12.25 ft). Stringer length = sqrt(147^2 + 108^2) = sqrt(21609 + 11664) = sqrt(33273) ≈ 182.4 in. Angle = arctan(108 / 147) ≈ 36.3 degrees, slightly steep but within a usable range.

How a stair runner is measuredOne step showing tread depth, riser height and the nosing wrap that all add together to give the runner length per step.Tread depthRiser heightNosing wrapRunner per step = tread + riser + nosing allowance
How each step contributes to total runner length: tread, riser and nosing wrap.

Worked example — UK units

Total rise: 2,700mm. Target riser: 190mm. N = 2700 / 190 = 14.2, round to 14 steps. Actual riser R = 2700 / 14 ≈ 192.9mm, within the 220mm Part K maximum. Choose going G = 225mm, satisfying the 220mm minimum with a small margin. Total run = 225 x 13 = 2,925mm. Stringer length = sqrt(2925^2 + 2700^2) = sqrt(8556225 + 7290000) = sqrt(15846225) ≈ 3,981mm. Angle = arctan(2700 / 2925) ≈ 42.7 degrees.

Rounding the step count changes everything downstream

Because N must be a whole number, rounding it up or down shifts the actual riser height away from your target — sometimes by half an inch or more. Always recalculate R after rounding N, rather than using your original target riser height in later steps; this is the single most common manual-calculation error a stair math calculator is built to prevent.

Step-by-step: doing the calculation by hand

  1. Measure total rise floor to floor with a spirit level and tape measure.
  2. Pick a target riser height inside your code's legal range (roughly 7-7.75 in / 180-196mm US, up to 220mm UK).
  3. Divide total rise by the target riser height and round to the nearest whole number to get N.
  4. Divide total rise by N again to get the exact, equal riser height for every step.
  5. Choose a tread depth that meets or exceeds the code minimum and feels comfortable (10-11 in / 250-280mm is typical).
  6. Multiply tread depth by (N minus 1) to get total run.
  7. Apply the Pythagorean theorem to total run and total rise to get stringer length.
  8. Use arctangent of rise over run to check the angle sits in a comfortable 30-37 degree range.

Checking your answer against comfort formulas

Comfort ruleTarget rangeHow to apply it
Riser + going17-18 in (430-460mm)Add your R and G together and check the range
2 x riser + going24-25 in (610-635mm)Double R, add G, check the range
Riser x going70-75 sq in (450-490 sq cm)Multiply R by G, a less common but useful cross-check
Angle30-37 degreesSteeper than this feels like a ladder; shallower eats floor space

From construction maths to runner length

Once N, R and G are settled, the same three numbers feed directly into carpet planning. Total runner length is roughly (N x G) plus (N x R) plus a tuck allowance — a different sum from the construction formulas above, because a runner wraps every tread and riser individually rather than following the diagonal stringer line. Anyone finishing a new stair math calculator build should run those same step counts through a stair runner calculator before ordering carpet.

Stair Math Calculator: The Formulas Behind Every Step — natural fibre runner on oak stairs

Handling a riser target that will not divide evenly

In practice, total rise almost never divides cleanly by a round target riser height, which is why N is always found by rounding rather than by exact division. If your total rise is, say, 101.5 in and your target riser is 7.25 in, the raw division gives 14.0 — an unusually tidy result — but change the total rise to 102 in and the same target gives 14.07, which still rounds to 14 steps but now produces an actual riser of 7.29 in rather than exactly 7.25 in. Carry the decimal through the whole calculation and only round the final riser height and stringer length once every other figure has been worked out; rounding total rise itself before dividing is what most often produces a small but real inconsistency across the flight.

Cross-checking the calculator with a second method

Before cutting a stringer, it is worth confirming a calculator's output with an independent check. A framing square with stair gauges (called stair buttons in the UK) set to the calculated riser and going figures lets you mark out one full step by hand and compare it physically against the numbers on screen. If the two do not match, the error is almost always a units mix-up — inches entered where millimetres were expected, or vice versa — rather than a fault in the arithmetic itself.

Know your numbers in 30 seconds

Enter your step count, tread depth and riser height — the stair runner calculator gives you the exact length to order, in metres and feet, with waste included.

Open the stair runner calculator

Whatever you decide, get the numbers first: the stair runner calculator doubles as a stair runner length calculator, adding nosing wrap, landings, winders, pattern repeat and waste so you order the right length the first time.

Still deciding on material, width or pattern? Our hub on stair runners compares weaves, widths, backings and fitting styles side by side, then hands the numbers straight to the calculator.

Frequently asked questions

What is the basic formula for the number of stair steps?

Divide the total floor-to-floor rise by a target riser height (commonly 7-7.5 in / 180-190mm) and round to the nearest whole number. That whole number is your step count, and dividing the total rise by it again gives you the exact, equal riser height for every step in the flight.

How do you calculate stringer length?

Use the Pythagorean theorem: stringer length equals the square root of (total run squared plus total rise squared). This gives the diagonal length of the board before the tread and riser notches are cut, so always add a small allowance for the top and bottom end cuts.

How is stair angle calculated?

Take the arctangent of total rise divided by total run. A comfortable residential staircase typically falls between 30 and 37 degrees; anything steeper starts to feel like a ladder, and anything shallower uses up more floor space than most homes can spare.

Why does rounding the step count matter so much?

Because building code requires every riser in a flight to be equal within a very small tolerance (around 0.375 in / 9.5mm in the US, 5mm in the UK), you cannot use a fractional step count. Rounding to the nearest whole number and recalculating the exact riser height afterward is what keeps every step legally and safely consistent.

What is the 17-18 inch rule?

It is a comfort formula stating that riser height plus tread depth should total roughly 17 to 18 inches (430-460mm). Staircases within this range tend to feel natural to walk, while totals outside it feel either cramped and steep or unnecessarily long and shallow.

Can I use these formulas for a spiral staircase?

Not directly. Spiral and curved staircases have a tread depth that varies continuously around the curve, so the simple N, R, G formulas above only apply to straight flights. Spiral layouts need a specialist calculation that accounts for the walk-line radius at each step.

Do these formulas also tell me how much stair runner I need?

Not on their own — construction formulas calculate stringer length along the diagonal, while a runner wraps horizontally and vertically over every tread and riser. Once you have your step count and tread/riser dimensions from the stair math calculator, run them through a dedicated stair runner calculator to get the carpet length.

What if my total rise is not a whole number of inches or millimetres?

Carry the decimal through the whole calculation rather than rounding early. Round only the final riser height and stringer length once every other figure has been calculated, since rounding total rise itself before dividing by step count is what most often produces a small but real riser inconsistency across the flight.

Know your numbers in 30 seconds

Enter your step count, tread depth and riser height — the stair runner calculator gives you the exact length to order, in metres and feet, with waste included.

Run the stair math calculator

Ready for real prices?

Get quotes from vetted stair runner suppliers and fitters near you. Free, no account, no obligation.

Get quotes

Every guide is written from hands-on measuring and fitting experience, checked against the calculator’s own maths, and re-reviewed whenever prices or methods change. Read our editorial standards.

Keep reading