Measure the distance between the finished floor surfaces at the top and bottom of the stair opening. This is the total rise.
Divide the total rise by 7.5 inches to obtain the number of steps. Round the number up. 7.5 inches is the approximate height of each step and is a comfortable height for most people.
Divide the total rise by the number of steps. This gives you the exact rise of each step, called the riser height. You can increase the number of steps for a shorter riser height or lower the number for a greater riser height. Riser heights usually must fall in the range of 4 to 8 inches, but check with the local building department for code requirements.
Measure the upper floor construction height from the top of the finished flooring surface to the bottom of the joists. The stairs must be constructed so that a minimum of 80 inches of headroom clearance is present between the upper floor construction and the steps. Add the upper floor construction height to the desired headroom clearance to get the total headroom clearance
Divide the total headroom clearance by the riser height to get the number of risers in the stairwell opening. Multiply the result by the tread length, which is usually 10 inches for the calculated stairwell length.
Add the stair tread nosing length and the thickness of the top riser to the calculated stairwell length for the total stairwell length. This is the length of the opening in the upper floor to accommodate the stairway with adequate headroom.