How to Calculate Stair Stringer Length: Formula and Worked Examples
Stair stringer length comes from one formula: the square root of total rise squared plus total run squared. This guide walks through the math with two worked examples and the mistakes that cost builders new lumber.

Every staircase is built on stringers, the sloped boards that support the treads and carry the weight of everyone who climbs the stair. Before you can mark one out with a framing square or buy the lumber, you need to know how long it has to be. A stringer that is a few inches too short is scrap, and one that is much too long wastes money and forces an awkward cut.
The math is simpler than it looks. A stringer is the hypotenuse of a right triangle whose other two sides are the total rise and total run of the stair, so one application of the Pythagorean theorem gives the exact length. This guide covers the formula, the two numbers it needs, two worked examples, and what the formula leaves out.
The Stringer Length Formula
Picture your staircase from the side. The vertical distance from the finished lower floor to the finished upper floor is the total rise. The horizontal distance the stair covers is the total run. The stringer connects those two points along the slope, forming the hypotenuse of that right triangle.
Stringer length = square root of (total rise squared + total run squared)
Square the total rise, square the total run, add the results, and take the square root. That is the length of the sloped edge of the stringer, where the treads will sit.
This works because every straight flight is geometrically a ramp with steps on it: the stringer edge, the height, and the horizontal span always form a right triangle. Curved and spiral stairs are a different problem, but for any straight flight this formula is all you need.
Step 1: Find Your Total Rise
Total rise is the vertical distance from the top of the finished lower floor to the top of the finished upper floor. The word "finished" matters: measure to the surface you will actually walk on, including flooring that is not installed yet. Measuring to the subfloor and then adding tile later throws off every riser height.
Stand a tape measure vertically where the bottom of the stair will sit and read the height to the finished upper floor. Write it down in inches; doing all the math in inches avoids the errors that come from mixing feet and inches. An 8-foot 7-1/2-inch reading becomes 103.5 inches.
The IRC caps individual risers at 7-3/4 inches (R311.7.5.1) and limits riser variation to 3/8 of an inch per flight. The formula will not check that, so confirm your riser count with a stair calculator before buying lumber.
Step 2: Find Your Total Run
Total run is the horizontal distance the stair covers, from the face of the bottom riser to the nosing of the top tread. It equals the unit run (the horizontal depth of one tread, usually 10 to 11 inches) multiplied by the number of treads.
Count treads, not risers. A flight with 14 risers has 13 treads, because the upper floor itself serves as the last tread. This is the most common arithmetic mistake in stringer math, and it adds one full unit run to the answer. With a 10.5-inch unit run and 13 treads, the total run is 136.5 inches.
The IRC requires a minimum tread depth of 10 inches (R311.7.5.2), measured horizontally between nosing projections; many builders use 10-1/2 or 11 inches for comfort. Keep the run consistent with your design, since changing it later changes the stringer length.
Worked Example 1: A Standard Indoor Stair
Take a common indoor case: finished floor to finished floor height of 103.5 inches, 14 risers at 7-3/8 inches each (within code), and 13 treads with a 10-1/2 inch unit run.
Total run: 13 x 10.5 = 136.5 inches.
- Square the total rise: 103.5 x 103.5 = 10,712.25
- Square the total run: 136.5 x 136.5 = 18,632.25
- Add them: 29,344.5
- Square root: about 171.3 inches
The stringer must be at least 171.3 inches long, or 14 feet 3-1/4 inches. In practice you would buy a 16-foot 2x12 and trim it, because the formula gives the sloped edge, not the full board: the top plumb cut and bottom level cut consume extra inches, so never order lumber cut to the exact length. Verify the layout with a stringer calculator before marking the board.
Worked Example 2: A Low Deck Stair
Now a short outdoor case: the deck surface sits 36 inches above the patio, with 5 risers at 7-1/5 inches each and 4 treads at an 11-inch unit run (deeper treads feel safer outdoors).
Total run: 4 x 11 = 44 inches.
- Square the total rise: 36 x 36 = 1,296
- Square the total run: 44 x 44 = 1,936
- Add them: 3,232
- Square root: about 56.9 inches
The stringer is just under 57 inches, about 4 feet 9 inches, so a standard 8-foot 2x12 leaves room for the cuts and a safety margin. The same formula handles a two-step stoop and a full two-story flight without any change; the triangle is the triangle.
What the Formula Does Not Cover
The formula gives the length of the sloped top edge, not the length of lumber to buy, and the difference matters.
First, the ends of a stringer are not cut square. The top meets the upper floor with a vertical plumb cut and the bottom meets the lower floor with a horizontal level cut. These cuts eat into the board, so the raw board must be several inches longer than the hypotenuse. Buy the next standard lumber length up rather than the exact number.
Second, the formula knows nothing about throat depth: the uncut wood between the deepest notch and the bottom edge of the board. A stringer cut too deep is weak, so keep at least 3-1/2 inches of solid wood at the thinnest point of a 2x12.
Third, waste and error margin: ends get trimmed square, knots get cut out, measurements get rechecked. A 2x12 comes in 8, 10, 12, 14, and 16 foot lengths, so pick the first length that comfortably exceeds your calculated stringer length plus the cut allowance.
Common Mistakes That Produce the Wrong Length
The most frequent error is counting risers instead of treads for the total run. A flight has one more riser than tread, so subtract one unit run before you square.
The second error is measuring total rise to the subfloor instead of the finished floor. Every layer of flooring added later makes each riser taller than planned, so measure finished to finished.
The third error is rounding too early: rounding risers before squaring introduces error the square root magnifies. Keep one decimal place through the calculation and round only the final answer.
The fourth error is adding nosing projection to the total run. Nosing does not change the stringer's slope or length; the unit run is the nosing-to-nosing distance the IRC measures as tread depth (R311.7.5.2).
Frequently Asked Questions
What is the formula for stair stringer length?
Stringer length equals the square root of (total rise squared plus total run squared). Square the floor-to-floor height, square the horizontal span, add them, and take the square root. The answer is the sloped-edge length in the same units you measured in.
Do I count risers or treads for the total run?
Count treads. Total run equals unit run times the number of treads, and a flight has one fewer tread than risers because the upper floor acts as the last tread. A 14-riser flight with a 10-1/2 inch unit run has a total run of 136.5 inches, not 147.
How much extra lumber should I buy beyond the calculated length?
Buy the next standard lumber length above the calculated stringer length: end cuts, square trimming, and a waste margin for knots all consume board. A 171-inch result means a 16-foot board, not a 14-foot one.
Does the nosing change the stringer length?
No. Nosing overhang changes neither the slope nor the length of the stringer; the unit run is the horizontal nosing-to-nosing distance that code measures as tread depth.
Can I use this formula for winder or spiral stairs?
No. The formula only works for straight flights, which are geometrically right triangles. Winders, curves, and spirals have varying tread depth and a changing slope, so they need a dedicated calculator or a full-scale layout.
Final Check Before You Buy
Calculate the stringer length, then sanity check the layout: risers at or under 7-3/4 inches, treads at or over 10 inches, riser variation within 3/8 of an inch. Confirm the full layout in a stair calculator or the dedicated stringer calculator, then buy one standard lumber length longer than the formula requires. One careful calculation and the stringer you cut will fit the first time.