Calculate board feet for lumber from the thickness, width, length, and quantity — the standard way lumber is priced.
board feet = (thickness_in × width_in × length_ft ÷ 12) × pieces
A board foot is 144 cubic inches of lumber — the standard unit for buying and pricing rough and dimensional lumber.
Lumber is sold by nominal size (a 2×4 is actually 1.5×3.5″). Board-foot pricing uses nominal dimensions.
A single 2 x 6 x 10 ft board is (2 x 6 x 10) ÷ 12 = 10 board feet. If you need 20 of them, that's 200 board feet before waste. Lumber yards price rough hardwood and some softwood by the board foot, so this is how you compare prices and estimate cost.
Note that board feet uses nominal dimensions. A '2x6' is actually 1.5 x 5.5 inches once surfaced, but board-foot pricing for dimensional lumber uses the nominal 2 x 6. For rough-sawn hardwood, measure the actual rough dimensions.
The board-foot formula is a definitional standard. Lumber yards price by board foot for rough lumber and by piece for dimensional studs.
Eight — (2 × 6 × 8) ÷ 12 = 8 board feet.