The size of nails for fence pickets depends on the thickness and type of wood being used. However, there are some general guidelines to follow. Most wooden fences have similarly sized pickets, so the best size of the nail would be 6d to 8d, which is like a 1.5 inch to 2 inches ring shank on the nails. For a framing nail gun, you will need 2 inch x .113 inch, exterior galvanized ring shank nails for your fence pickets. If you are nailing 5/8" pickets to 2x4" rails, 2-inch long nails would be perfect. Depending on the thickness of your fence pickets, you could get away with 1.5 inch long nails as well. Make sure they are hot-dipped galvanized rather than electro-galvanized, or they could stain certain woods. Don’t use smooth shank nails as they will pull out rather quickly. The ring shank holds much better. Cheaper interior nails will rust almost immediately. Alternatively, you can use 1 ¼″ to 1 ¾″ long screws to secure the pickets, but this will take considerably longer to apply. In both cases, you will need to use galvanized nails or screws, otherwise, they will rust after a relatively short time.