The best nail size for framing depends on the size and relationship of the lumber parts being fastened. For most framing, use "common" nails, which are thicker and stronger than "box" or "sinker" nails.
Common nail lengths are denoted by the "penny" system, indicated by a number followed by "d." The three nail sizes used for most framing jobs are 16d, 10d and 8d.
All 16d nails are 3 1/2 inches long. Use them to fasten framing materials at right angles, such as wall plates to studs or rim joists to joists for floor or deck frames.
At 3 inches long, 10d nails are appropriate for joining two boards set together flat on their faces, such as where floor joists overlap, when doubling-up studs or building window and door headers.
Use 8d nails, which are 2 1/2 inches long, for toenailing--driving a nail at an angle through the end of one member and into the face of the mating member. Toenailing is used to attach studs to wall plates, or rafters to wall top plates or beams.
When framing with metal anchors, such as joist hangers, always follow the anchor manufacturer's specifications for nails.