Which code applies
Most US states and towns build houses to the International Residential Code (IRC), often with local amendments. The numbers above are from the IRC; your building department has the final say, so check before you build. Decks and deck stairs follow the same rules.
Designing stairs that pass
Start from the total rise, pick the fewest risers that keep each one at or under 7 3/4", and give each tread at least 10". The stair calculator does this and flags any rule you miss. For the railing, the baluster spacing calculator keeps every gap under 4".