The most common screw for joining two-by-fours is hardened steel, structural, No. 9, 2 1/2 inches long with a Phillips head. Other screw types appropriate for studs are specialized and may be harder to find and more expensive. It's important that the screw is designated as a structural screw or a deck screw. Drywall screws, readily available and cheap, are a poor substitute. They're brittle and can snap off.
Two-by-fours are 1 1/2 inches thick. Two of them placed together flat equal 3 inches. It might seem appropriate to use 3-inch screws, but modern drill/drivers and impact drivers bury the head of the screw up to 1/2 inch, and the tip of a 3-inch screw can penetrate out the other side. Screws that measure 2 1/2 inches are more appropriate for two-by-fours placed flat, allowing you to bury the head as needed. If you're angling the screw, such as in a toenail application, or when end nailing—driving through the broad face of one two-by-four and into the edge or end of another—you can use longer screws.
Screws Vs. Nails
Framing lumber is typically fir or similar softwood, and screws often do not require pilot holes. With their coarse threads, screws hold better than nails and have more withdrawal force resistance than nails. Screws are less likely to pop out or surface than nails when wood expands or contracts. There's less banging with a hammer, and less damage to objects on the other side of the wall. However, screws often take longer to install than nails, and sometimes pilot holes are required to prevent splitting the wood or binding or breaking the screw.
Wood screws come in a wide variety of drive types, including Phillips, square-drive, Torx, T-star and hex-head. One important yet often overlooked aspect is screw tip or driver size. An improperly sized screw tip offers poor driving performance and can strip or ruin the screw. Screw sizes appropriate for joining two-by-fours are designated by numbers. No. 9 and 10 screws are the most common for studs, and driver tips should correspond with those screw sizes. For example, a standard No. 2 Phillips tip is appropriate for No. 9 and some No. 10 screws. Other drive types have more specific sizing; a No. 2 square-drive tip fits only No. 2 square-drive screws.
Avoid slotted screws. They're harder to drive and strip much more easily than other screw types.
Some structural screws have built-in washers that prevent the head from countersinking into the wood, for added strength. Others have hex heads and are designed for use with metal framing connectors but can also be used for wood-to-wood connections. There's also a variety of specialty construction screws, which have features like self-drilling threads, high strength for structural applications, and heads that create their own countersink holes. Specialty screws tend to be expensive and often are used for timber framing and log construction, but they might be worth the expense for special two-by-four framing applications.
Several types of coatings are available for screws. Hot-dipped galvanized and stainless steel fasteners are recommended for applications where a maximum amount of protection from corrosion is desired and for use with pressure-treated lumber. Standard electroplated or mechanically galvanized screws also provide corrosion protection, but the level of performance varies. Deck screws often carry a corrosion-resistant coating; only some of these are rated for pressure-treated lumber. Check the manufacturer's specifications for your application.