Quick answer: To calculate a stair stringer: divide total rise by about 7.5 inches for the number of risers, divide the rise by that count for the riser height, multiply the treads (risers − 1) by the tread depth for total run, then take √(rise² + run²) for the stringer length.
A stringer is the diagonal, sawtooth-cut 2x12 that carries the treads and risers of a staircase. Cutting one accurately comes down to four numbers: how many steps, how tall each riser is, how deep each tread is, and how long the board needs to be.
Say your total rise is 108 inches (9 ft) and you want a 10.5 in tread:
Clamp two stair gauges to a framing square — one at your riser height on the narrow tongue, one at your tread depth on the wide blade. Then:
Stringer length is the diagonal of the staircase: the square root of the total rise squared plus the total run squared. For a 108-inch rise and a 130-inch run, the stringer is about 169 inches, and you would buy the next standard board length up.
Number of risers = total rise ÷ 7.5, rounded. Riser height = total rise ÷ number of risers. Total run = (risers − 1) × tread depth. Stringer length = √(rise² + run²).
Clamp stair gauges to the framing square at your riser height on the tongue and your tread depth on the blade. Step the square down the board, tracing the riser and tread for each step, then square off the top plumb cut and bottom level cut.
Subtract one tread thickness from the bottom riser cut so the finished first step ends up the same height as the rest. Skipping this makes the bottom step too tall.
Space stringers no more than 18 inches apart for 2x wood treads, or 12 to 16 inches for composite. A standard 36-inch stair uses 3 stringers.