For a typical treehouse, use lag bolts that are long enough to pass through the treehouse beam and penetrate at least 3 inches into solid heartwood, with 4 to 6 inches into the tree being the practical target. In most backyard builds that works out to roughly 6- to 8-inch lag screws through a 2x6 or 4x4, but the correct length is set by how deep the bolt must go into the tree rather than by the thickness of the lumber alone — and on a living tree, the fastener question is secondary to the larger problem that lag bolts into a growing trunk are a poor long-term attachment method.

The direct answer, with the qualification that actually matters

The number most people are looking for is 4 to 6 inches of embedment into the tree, plus the full thickness of whatever the bolt passes through. So the bolt length is:

bolt length ≈ beam or bracket thickness + 4 to 6 inches of embedment

A 4x4 ledger bolted flat against a trunk, for example, calls for roughly an 8-inch lag; a 2x6 rail or rim joist calls for about a 6- to 8-inch lag. That is the short version. The longer version is that penetration depth into wood is not the same thing as safe attachment to a live tree, and the two get conflated constantly in treehouse discussions. A lag bolt can be perfectly sized and still be the wrong hardware for the job.

Why 4 to 6 inches into the tree?

Lag screws (and lag bolts, which in common American usage means the same heavy hex- or washer-head fastener) carry load through the threads engaging wood fibers along their length. The more thread depth in sound wood, the more withdrawal and shear capacity the connection has. But the returns fall off: once you are several inches into the trunk, you are no longer adding much to the connection and you are doing more damage to the tree.

Several practical rules shape the range:

Too short is the real danger. A 4-inch lag through a 1½-inch-thick 2x4 leaves only 2½ inches in the tree. In a softwood like pine or cedar, that is marginal to inadequate for a loaded floor beam. Past about 6 inches of penetration, additional length adds little. The wood beyond that depth is not doing much work in the connection, and a longer, thicker bolt means a larger wound. Deeper is not automatically safer for the tree. Every hole is a permanent wound, and a cluster of deep bolts near each other compounds the damage.

Diameter matters alongside length, and the two are usually chosen together. For structural treehouse connections, ½-inch-diameter lag screws are the common baseline; ⅜-inch is used for lighter loads and ⅝-inch or larger for heavy beams and multi-point hubs. As a rule of thumb, embedment of roughly 7 to 10 times the bolt diameter is the minimum for strong withdrawal resistance in solid softwood — which is why a ½-inch lag wants about 4 inches minimum, comfortably inside the 4-to-6-inch window.

One more sizing point that trips people up: a "1/2 x 6" lag screw is 6 inches long overall, including the head. The threaded portion is shorter than the nominal length, so do not assume a 6-inch lag gives you 6 inches of thread in the tree.

The table most builders want

Assuming the bolt passes through a single structural member and the rest goes into sound heartwood, here is a reasonable starting point:

What the bolt passes through Nominal thickness Suggested lag length Threaded embedment in tree
2x4 1½ in 6 in ~4 in
2x6 1½ in 6–8 in 4–6 in
4x4 (flat) 3½ in 8 in ~4 in
4x6 or double 2x6 3–3½ in 8–10 in 4–6 in
6x6 beam 5½ in 10 in (or through-bolt) ~4 in

Treat this as a planning aid, not a stamped design. Species, moisture content, grain orientation, load, and the number of fasteners all change the answer, and a licensed engineer or a tree-care professional should sign off on anything holding people above the ground.

The distinction that changes the answer: a tree is not a post

If you are bolting a ledger to a dead post, a utility pole, or a structural timber, the table above is essentially the whole answer. A tree is different, and this is where most treehouse safety mistakes begin.

A living trunk is wrapped in bark and a thin layer of living tissue, and it grows outward every year. Lag bolts driven into a trunk do not move with that growth. Over time several things happen:

The tree adds tissue around the bolt, but the wood immediately around the threads is crushed and compartmentalized, and it does not regain the strength the bolt originally had. If the platform is rigid and the tree sways in wind — which it does, more than most people expect — the fasteners and the wood around them are cyclically loaded and can loosen or enlarge their holes. Bolts are effectively permanent wounds. A tree can seal over small holes, but a pattern of deep, large-diameter bolts, especially in a ring around the trunk, can create long-term decay or structural problems.

This is why experienced treehouse builders generally avoid driving lag bolts directly into the trunk to carry the structure. The common alternatives:

Through-bolts with a backing plate on the far side of a limb or trunk — more reliable than a lag in tension, but still a permanent wound. Treehouse attachment bolts (TABs) and similar proprietary brackets, which are engineered single-point fasteners designed to be the connection between a tree and a structure. Cable-and-collar or suspension systems that let the tree move independently of the platform. A support structure on posts beside the tree, with the treehouse touching or encircling the trunk rather than hanging from it.

For anything above a low play platform, the attachment method deserves as much attention as bolt length. A regional arborist or a builder who specializes in treehouses can tell you what is appropriate for your species and situation.

How to apply this to common treehouse designs

Beams bolted directly to the trunk. Calculate bolt length as beam thickness plus 4 to 6 inches of embedment, and use ½-inch diameter at minimum. But understand you are choosing the simplest attachment, not the best one. Use the fewest bolts that will carry the load, space them well apart, and avoid putting several in one horizontal line around the trunk.

A bracket bolted to the tree, with joists hung or bolted to the bracket. Here the bracket's designed thickness sets the bolt length; follow the bracket manufacturer's specification over any generic rule. This is where many commercial systems give you a specific bolt and depth, and that specification should win.

A rim joist or ledger attached to posts rather than the tree. If no part of the connection enters the trunk, this is ordinary structural carpentry, and the standard embedment rules apply. Bolt length is joist thickness plus 4 to 6 inches into the post or beam, with through-bolts often preferred for a clean, inspectable connection.

A platform that only rests against or encircles the tree. No penetrative fastener is needed for the platform itself; the tree is a guide, not a support. Bolt length is then irrelevant to tree attachment, which is often the safest arrangement.

Practical checks before you drill

Confirm the wood is sound where you are drilling. A drill bit or an awl will tell you quickly whether you are in solid heartwood or punky, decayed material. If it is soft, stop and reassess. Pre-drill properly. Lag screws of this size need a pilot hole sized to the shank (not the threads) of the specific fastener, and the hole in the beam should be slightly oversized so the bolt can draw the member tight. Avoid the obvious failure points. Do not bolt into a crotch, a wound, a hollow, or a spot with fungal conk bodies nearby. Use washers. A heavy washer under the head spreads the load across the wood and reduces crushing. Plan for inspection. Every fastener should be visible and reachable so you can check for loosening, corrosion, and decay. Galvanized or stainless hardware is the default outdoors. Remember that "how long" is only one of three numbers. Length, diameter, and number of fasteners work together. A single long bolt is not a substitute for an adequately sized and placed connection.

What the length rule does not settle

It does not tell you whether lag bolts are the right attachment at all — for a living tree, quite often they are not. It does not account for the species, the tree's health, the load, the wind exposure, or the platform's rigidity. And it does not substitute for engineering on anything beyond a small, low platform. If the treehouse will be occupied by children, or will be high enough that a fall matters, have the attachment design reviewed by someone qualified, and have the tree assessed by an arborist. Getting the bolt length right is necessary. It is not sufficient.