What are the regulations for railings on a deck or porch?

You can go up to a max height of 30" before railings need to be installed on a deck.  If you have more than two risers you will need a handrail.  Railings will need to be 36" in height and you will need a top and bottom but no intermittent rail.  Balusters need to be vertical and the max space between balusters must be 4".