Use a tape measure to measure the horizontal distance between the finished walls on either side of the stairwell opening. This measurement will give you the rough opening size.
Step 2: Add the appropriate amount for overhang.
The amount of overhang you add to the rough opening size depends on the type of stair railing you are installing. For a standard railing with 3-1/2-inch posts, add 3 inches to the rough opening size. For a railing with 4-inch posts, add 4 inches to the rough opening size.
Step 3: Subtract the baluster spacing.
The baluster spacing is the distance between the individual balusters in the railing. The standard baluster spacing is 4 inches. To determine the total baluster spacing, multiply the number of balusters you need by 4 inches.
Step 4: Add the top rail length.
The top rail is the horizontal member of the railing that runs along the top of the balusters. The top rail length is equal to the sum of the rough opening size, the amount of overhang, and the total baluster spacing.
Example
Let's say you are installing a standard railing with 3-1/2-inch posts on a stairwell with a rough opening size of 4 feet. The total baluster spacing for a railing with 10 balusters is 40 inches.
To calculate the stair railing length, we would first add the appropriate amount for overhang: 4 feet + 3 inches = 4 feet 3 inches.
Next, we would subtract the baluster spacing: 4 feet 3 inches - 40 inches = 3 feet 11 inches.
Finally, we would add the top rail length: 3 feet 11 inches + 4 inches = 4 feet 3 inches.