Use a plumb line to determine the plumb, or straightness, of the walls or posts that will hold the gate panels. This will warn you about disparities in measurement that may occur.
Measure the open, horizontal span where the gate will be by holding the tape 2 inches above the ground. Write down this number
Measure the horizontal span at the level of the highest point of the gate. Write this number down. A discrepancy between the lower measurement and the higher measurement means that the two sides are not plumb. You will have to fabricate the gate to the smaller dimension, and add shims to provide additional material on one or the other side to allow for installation.
Subtract the measured width of the hinge assembly from the width of the gate opening that you measured in Step 3.
Subtract from the number in Step 4 the width of the vertical post on either end of the perimeter frame of the gate. The number that remains is the space available for the pickets, or rails, of your gate and the spaces that separate them.
Calculate the number of rails and spaces that will fit into this number. For instance, if you have 1-inch rails and 4-inch spaces, you must calculate how many 5-inch units can be fitted into the remaining number. You can adjust this to fit whatever size material you wish to use, such as ½-inch rails or pickets. You can also adjust the amount of spacing between rails.