Fit a stair into a space
Give it the height and the run you have to work with. It reports every riser count that fits, ranked, and says plainly when none does.
Why the riser count is the only thing to adjust
Both of your measurements are fixed, so there is exactly one lever: how many risers the flight is divided into. Everything else follows from it.
riser = total rise / risers
treads = risers − 1 (when the top step is the upper floor)
room each = run available / treads
going = the smaller of (room each) and (the comfortable going for that riser)
That last line is the one worth reading twice. If the space allows a deeper tread than comfort calls for, the extra is reported as space left over rather than spent. A tread much past 11″ makes people break stride on the way down, which is the opposite of what a generous hallway was supposed to buy you.
Fewer risers make a shorter stair
This catches people out. Adding risers makes each one shorter and the stair gentler, but it also adds treads — and every added tread is another full going of run. So when space is tight the answer is fewer, taller risers, right up to the limit the code allows. That limit is what decides whether anything fits at all: the shortest legal straight flight is the minimum riser count at the minimum tread depth, and if that will not fit, nothing will.
When nothing fits
The calculator says so rather than offering a stair that breaks the code. The usual ways out are a landing with a half-turn, which folds the run back on itself and roughly halves the depth needed; winders, which turn within the flight and gain depth without a landing; or finding more space. A steeper flight is not on that list — the riser and tread limits are the one thing in stair design with no give in it.
Before you cut
Take the chosen riser count to the stair calculator for the cut list and the framing-square settings, and check the floor opening — a stair that fits the floor plan can still fail on headroom.