You've got the tape measure out, you know how many inches your deck sits off the ground, and now you're standing there trying to do stair math in your head. If that's where you are right now, you're not alone — this is exactly the point where most first-time deck builders stall out.
Framing the deck itself is mostly repetition. Set a post, hang a joist, screw down a board, repeat forty more times. Stairs don't work that way. Get the geometry even slightly wrong and you end up with steps that feel "off" every time someone walks up them, even if nobody can quite explain why. This guide walks through exactly how the math works, using real numbers, so you can mark your lumber once and cut with confidence.
Why Stair Math Is Less Forgiving Than It Looks
Here's what catches people off guard: a deck frame has some built-in tolerance. A joist that's a quarter-inch out of level almost never matters to anyone. A stair riser that's a quarter-inch different from the one below it is a different story — your foot notices, even when your eyes can't see the difference. It's the single most common reason people trip on stairs they built themselves.
That's not bad luck. Your brain memorizes the rhythm of the first two or three steps almost instantly, then stops paying close attention to exactly where your foot needs to land. The moment a riser breaks that rhythm, even by a fraction of an inch, your foot comes down too early or too late. Building codes don't just cap how tall a riser is allowed to be — they also require every riser in a flight to stay within 3/8 inch of every other one, for exactly this reason. It isn't a bureaucratic technicality. It's the whole reason stair math has to be calculated properly instead of eyeballed with a tape measure and a guess.
Let's Work Through a Real Example
Say your deck sits 38 inches above the ground, a pretty common height for a single-level deck with a walkout basement underneath. Here's the exact sequence a builder runs through, in order.
Step 1: Find your number of steps. Most US building codes cap riser height at 7¾ inches. Divide your total rise by that number: 38 ÷ 7.75 works out to 4.9. Here's the detail that trips people up — you round up to 5, not to the nearest whole number the "normal" way. Round down, or round to the nearest number, and you risk ending up with a riser taller than code allows. Rounding up first, then recalculating, always keeps you inside the limit.
Step 2: Find your actual riser height. Divide the total rise by your step count: 38 ÷ 5 = 7.6 inches. That's your exact riser height, and all five risers get cut to that number — not "close to" it, exactly that.
Step 3: Pick a tread depth. Code minimum is 10 inches, but most builders use somewhere between 10.5 and 11 inches for a more comfortable step. We'll use 10.5.
Step 4: Find your total run. You'll always have one fewer tread than you have risers, because the deck surface itself acts as your final step. Five risers means four treads: 4 × 10.5 = 42 inches of horizontal run.
Step 5: Find your stringer length. This is where the Pythagorean theorem shows up — the one from ninth-grade geometry, finally useful for something. Picture your stringer as the long diagonal side of a right triangle, where one leg is your total rise (38") and the other is your total run (42"). The formula is stringer length = √(rise² + run²), which comes out to √(1,444 + 1,764) = √3,208 ≈ 56.6 inches. That's the shortest 2×12 that will physically contain your cut pattern — in practice, buy a board about a foot longer than that, to leave room for the seat cut at the bottom and the angled cut at the top.
Step 6: Find your cut angle. Divide riser by tread: 7.6 ÷ 10.5 ≈ 0.724. Take the arctangent of that number and you land on 35.9 degrees — the exact angle you'd set on a speed square for every riser cut on this stringer.
Six steps, two formulas, and you've gone from "how tall is my deck" to knowing precisely what to mark on your lumber before you ever pick up a saw.
Where DIYers Actually Lose Time (and Lumber)
A handful of mistakes show up again and again on deck stair projects, and almost none of them are about the math itself.
Forgetting that the top step is the deck surface. New builders sometimes calculate five risers and then notch five full tread cuts into the stringer to match — but the top riser leads straight into the decking itself, so a five-riser stringer only gets four tread notches, not five. Miss this and your top step ends up noticeably higher or lower than the deck it's supposed to meet.
Cutting the seat notch before checking the ground. The bottom of a stringer needs to land on something level and solid — a concrete pad, a paver, or well-compacted gravel. If that surface isn't exactly where you assumed when you did your math, your carefully calculated riser height is already wrong before your first cut. Dig and level the footing first, then finalize your cut list.
Copying a neighbor's numbers instead of running your own. Every deck height is different, and a riser height that worked perfectly on a friend's 32-inch deck won't necessarily work on yours. The six steps above take about two minutes once you know them, and they're the only real way to be sure your specific stairs are dialed in.
Do the Math Once, Then Let the Tool Handle the Rest
Working through these formulas by hand, at least once, is genuinely worth doing — it's satisfying to understand exactly why the numbers land where they do, and it makes you a better judge of whether a number "looks right" later on. But once you're standing in the lumber aisle trying to decide between an 8-foot and a 10-foot 2×12, or double-checking an angle right before an irreversible cut, you want a fast, exact answer — not a phone calculator and a scrap of paper.
That's exactly why we built a free stair stringer and deck material calculator. Enter your deck height, and it instantly gives you your riser height, tread depth, cut angle, stringer length, and exactly how many boards to buy — plus a scaled sketch you can hold your stringer against to double-check every cut before you make it. It also has a second mode for deck board spacing and material counts, so you can plan the stairs and the decking in the same place.
The next time you're standing at the base of your deck with a tape measure, you won't need to do any of this in your head. Measure your rise, run the six steps above — or skip straight to the calculator above — and cut once.
.jpg)