The screw that matters most for a wall shelf is usually not the screw at all but the connection it makes: into wood studs or solid blocking, use coarse-thread wood screws of appropriate length and gauge; into hollow drywall or plaster without a stud behind it, the fastener must be a rated hollow-wall anchor matched to the shelf's load, and ordinary wood screws driven into bare drywall will not hold a loaded shelf. The screw that joins the bracket to the shelf is a separate, usually smaller decision, and the two should be chosen independently.

This answer treats "wall shelves" as shelves fixed to interior residential walls with brackets, cleats, or a hanging rail, in typical North American light-frame construction: wood or steel studs behind gypsum drywall, sometimes plaster over lath, masonry, or concrete. It is not a structural engineering specification. Because the shelf's span, depth, intended load, wall construction, and bracket design are not given, no single screw size or type can be named; what follows is the decision logic, with the load limits and code questions that must be verified locally.

First, Decide What the Screw Is Fastening

A wall shelf generally involves three distinct fasteners, and conflating them causes most failures.

Wall fastener: the screw or anchor that transfers the shelf's weight and its lever-arm moment into the building structure. This is the critical one. Bracket-to-shelf screw: a short wood screw, often 1/2 to 3/4 inch, driven up through the bracket's arm into the underside of the shelf. It resists the shelf sliding or tipping, not the vertical load. Cleat or ledger screw: when a shelf rests on a wooden cleat screwed to the wall, the cleat-to-wall screws carry everything, and the cleat itself must be thick enough (commonly 3/4-inch nominal stock or thicker) that screws do not split it.

A shelf supported by L-brackets puts the wall fasteners in tension and shear, because the load hangs out from the wall and tries to pull the top of the bracket away. A shelf on a full-width cleat loaded evenly acts mostly in shear, with much less pull-out demand. That difference should drive the fastener choice more than the shelf's appearance does.

Fastening into Wood Studs

Wood studs are the best common substrate. Standard light-frame studs are nominally 2x4s (actual 1-1/2 by 3-1/2 inches) or, in some interior partitions, 2x3s, spaced 16 or 24 inches on center, though older and remodeled walls vary. Stud edges can be located with a stud finder, by probing with a thin nail, or by finding the drywall seams and screw rows.

For a stud connection, use coarse-thread wood screws, not drywall screws and not machine screws. Drywall screws are hard and brittle, have small heads and thin shanks, and are designed for pulling gypsum board tight; they are a poor choice for structural shelf loads and can snap under bending. General-purpose wood screws with a smooth upper shank and threaded lower portion clamp the bracket firmly.

Sizing guidance, stated as general practice rather than a rule:

Situation Typical wall screw Notes
Bracket into wood stud, light shelf #8 or #10 wood screw, 2 to 2-1/2 in long At least 1 to 1-1/4 in of thread into the stud
Bracket into stud, heavier shelf or deep brackets #10 or #12 wood screw, 2-1/2 to 3 in Longer embedment matters more than a bigger head
Cleat into studs #10 to #14 wood screws, 2-1/2 to 3 in, two per stud Stagger or pair screws to resist the cleat rotating
Near a stud edge Predrill Prevents splitting, especially in old or dry lumber

The governing principle is embedment depth in solid wood, not overall screw length. A 3-inch screw through a 1/2-inch bracket plate and 1/2-inch drywall gives about 2 inches in the stud; a 3-inch screw through a thick bracket plus 5/8-inch drywall may give only 1-3/8 inches. A rough working target is at least 1 inch of threaded engagement in the stud for light loads and closer to 1-1/2 inches or more for heavier ones. Screws should not be so long that they risk hitting wiring or plumbing run through the stud bay; keep screws to the front face of studs and avoid the middle of the stud where cables and pipes are often drilled.

Pilot holes should be slightly smaller than the screw's minor (core) diameter in hardwoods and near the root diameter in softwoods; overdrilling reduces holding power. Do not overtighten, which strips the hole. If a hole strips, move to a fresh spot on the stud or plug the hole with a glued hardwood dowel and redrill.

Fastening into Hollow Drywall and Plaster

Drywall alone has very little pull-out strength, and a wood screw threaded into gypsum will fail under modest load, often by crumbling the paper and gypsum around the threads. The correct approach is a rated hollow-wall anchor, chosen for the wall thickness and expected load. Common types, with their character:

Self-drilling metal anchors (often called "zinc" or expansion anchors): install with a screwdriver or drill, spread behind the board. Suitable for light to moderate loads and thin-to-standard drywall; many carry published load ratings per anchor. Toggle bolts: a metal bar flips open behind the wall and spreads the load over a larger area. Strong for their size in drywall and useful where the bracket hole is small; they require a hole large enough for the toggle to pass, and the bolt cannot be removed and reused easily. Molly bolts (sleeve anchors): a sleeve expands behind the board. Good in thin drywall; load ratings are modest and the installation hole must match exactly. Threaded plastic anchors: acceptable only for very light loads; they are the weakest common option and are easy to overload. SnapTOGGLE-type and strap toggles: designed for very thin drywall and for holding without a large hole; convenient but still limited by the board itself.

Anchors only work if the bracket's mounting hole is compatible. A bracket with a countersunk hole for a flat-head screw may need a flat-head machine screw into the anchor; a bracket with a slotted hole may accept a pan-head. Match the screw to the anchor's specified size rather than forcing a larger wood screw into a plastic anchor.

Load ratings matter. Anchor manufacturers publish allowable loads in specific drywall thicknesses, and a common pattern is that a single anchor in 1/2-inch drywall may be rated for a few tens of pounds in shear—far more than a light shelf needs, but far less than a bookshelf full of hardbacks distributed across only two anchors. Remember that ratings are usually for a single fastener in ideal new drywall; old, crumbled, patched, damp, or double-layer walls change the picture. Distribute load across at least two anchors per bracket line and prefer four where geometry allows. Use the longest anchor the wall depth permits, and check that it will not hit anything behind the board.

Plaster over wood lath is a special case: the plaster is brittle and the lath is a thin, spaced substrate, so anchors that rely on gripping a clean hole can crumble the plaster key. Some anchors designed for plaster and lath exist, and in many cases the practical answer is to find the lath and screw into it with a wood screw, or to add blocking. Plaster over gypsum lath or over blueboard behaves more like drywall. Because wall construction is unknown here, this is a place to inspect before drilling.

When No Stud Is Where You Need It

If the bracket lands between studs, the options are, in rough order of robustness:

1: Relocate the brackets to align with studs, adjusting shelf span or adding a third bracket. 2: Add solid blocking inside the wall—a 2x4 or plywood block screwed between studs—then fasten through the drywall into the block with wood screws. This is the most reliable fix but requires opening the wall or working through an existing hole. 3: Use a wall-mounted hanging rail or cleat screwed into studs, with brackets hanging from the rail wherever needed. This is common for adjustable shelving systems. 4: Use rated hollow-wall anchors at the bracket locations, sized to the load, with realistic expectations. This works well for light shelves (display items, a few books, kitchen spices) and poorly for heavy or deep shelves.

Strength also depends on geometry. A 12-inch-deep bracket holding 40 pounds creates roughly 480 pound-inches of overturning moment at the wall, which becomes a large pull-out force on the top fasteners. Two small drywall anchors are unlikely to be adequate for that; studs or blocking are the honest answer.

Matching Screw to Bracket and Shelf Material

Bracket holes often dictate the screw head. Countersunk holes want flat-head screws so the head sits flush; slotted or keyhole holes want pan or round heads with washers; some brackets specify a machine screw because the bracket is predrilled at a fixed diameter. Driving a coarse wood screw through a closely sized metal hole can crack the bracket or strip the hole, and using a machine screw into wood without an insert will not hold.

For the shelf itself:

Solid wood shelves: wood screws into pilot holes, length about two-thirds the shelf thickness plus bracket thickness, so the tip does not break through the top surface. For a 3/4-inch shelf, 1/2-inch screws are typical. Plywood and MDF: similar, but MDF splits and crumbles at edges, so predrill and avoid screws too close to the edge; particleboard is weaker still. Glass shelves: never drill or screw through the glass; use brackets with clamping pads or a shelf-pin system designed for glass, and rely on the wall fasteners plus pins. Metal or wire shelves: use the manufacturer's hardware; often machine screws into threaded fittings.

A Practical Selection Procedure

1: Locate studs and mark centerlines; check where brackets will land. 2: Confirm wall buildup: drywall thickness, presence of plaster, tile, or paneling, and whether anything (cabinets, wiring, plumbing) runs behind. 3: Estimate the shelf load honestly—including the shelf board itself and the lever arm of its depth. 4: Choose the substrate: studs or blocking for anything beyond light display use; rated anchors only for light loads in sound drywall. 5: Pick the wall screw by embedment, not by length alone: coarse-thread wood screws for wood, anchor-specific screws for anchors, and never drywall screws for load-bearing shelf connections. 6: Match the head to the bracket hole; use a washer where the hole is oversized or slotted. 7: Predrill, install two fasteners per bracket where possible, and tighten snugly without stripping. 8: Attach the shelf to the brackets with short wood screws, and check for wobble, pull-out, and any sign of the bracket bending.

Common Confusions and Where the Advice Stops

"Wood screw" and "drywall screw" are often treated as interchangeable in casual speech; they are not, and the difference is specifically about brittleness, head shape, and thread design for grip in solid wood. "Anchor" is often used loosely for any plastic plug, but toggle and Molly anchors behave very differently from friction-fit plastic sleeves. "Load rating" is often quoted without the wall thickness and installation condition it assumes.

This answer also stops at several boundaries. Steel studs require self-drilling screws and, for shelf loads, often blocking or a designed bracket system; ordinary wood screws will not hold in thin steel. Masonry and concrete require masonry anchors or screws with compatible plugs, and the correct type depends on whether the material is brick, block, or cast concrete. Exterior or humid locations, fire-rated assemblies, seismic regions, and walls containing radiant heating or significant services have additional constraints. No specific screw size can be certified without knowing the shelf, the load, the bracket, and the wall, and published anchor ratings should be read from the actual product literature for the wall thickness in use rather than assumed. Where a shelf must hold substantial weight—books, tools, appliances—the reliable answer is solid framing or engineered blocking, not a cleverer anchor.