How the stair math works
Stairs have one non-negotiable constraint: every riser must be identical, and you can't have a fraction of a step. So the calculation runs backwards from what you'd expect. Divide the total rise by your target riser height (7.5 inches is the sweet spot for most homes), round to the nearest whole number — that's your riser count — then divide the rise evenly across them to get the actual riser height. It's almost never exactly 7.5, and that's fine; what matters is that it's consistent and under the code maximum.
A flight always has one fewer tread than risers, because the top landing serves as the final step. Total run is treads × tread depth, and the stringer — the diagonal 2×12 the steps are cut into — is the hypotenuse of the rise-run triangle.
The formulas
Rise is the total floor-to-floor height in inches (measure it — don't trust the plans), target is your preferred riser height, and tread is the horizontal depth of each step. All results are in inches.
Worked example
A basement stair with a 106-inch total rise, using the default 7.5-inch target riser and 10.5-inch treads: 106 ÷ 7.5 = 14.13, which rounds to 14 risers. Actual riser height is 106 ÷ 14 = 7.57 in — under the 7.75-inch IRC maximum. That gives 13 treads and a total run of 13 × 10.5 = 136.5 in (11.38 ft). The stringer is √(106² + 136.5²) = 172.82 in, so you'd cut from 16-foot 2×12 stock. Comfort check: 2 × 7.57 + 10.5 = 25.64 — right in the natural-stride zone.
The 2R + T rule, and the code limits that actually matter
Carpenters have used the same comfort formula for three centuries: twice the riser plus the tread should come to about 24-25 inches, the length of a comfortable human stride on a slope. Shorter and the stair feels cramped; longer and you're stretching. The IRC residential limits (R311.7.5) are the hard boundaries: risers no taller than 7¾ inches, treads no shallower than 10 inches, and no more than ⅜ inch of variation between the tallest and shortest riser in the flight — your legs memorize step one and a single odd riser is how people fall. Two more numbers worth knowing before you cut: minimum headroom is 6′8″ measured plumb from the tread nosing line, which is what usually forces a stair to be relocated rather than resized; and remember to subtract finish-floor thickness at top and bottom before laying out the stringer, or your first and last risers will bust the ⅜-inch rule on day one.