If you are building a deck that has a grade above 30 inches, you are required to build a railing that meets minimum height and other safety requirements as determined by building codes.
The International Residential Code requires that you build guardrails to a height of at least 36 inches for residential, detached homes.
The International Building Code requires that you build guardrails to at least 42 inches tall for commercial buildings, including apartment buildings and some businesses.
Contact your local municipality for information about the specific codes required in your area as they may vary from the International Residential Codes or International Building Codes. You can build taller guardrails than stated by code, but they must meet the minimum code requirements. Railing height is determined by measuring from the surface of the deck to the top of the railing.