Measure inside the bed
Use the inside length and width. Measure from the bottom of the space you will fill to your intended soil surface. A 12-inch-tall frame does not require 12 inches of soil if you plan to leave room below the rim or use another fill material below the soil. If the bed already contains soil, measure its current height too.
Calculate only the soil you will add
For a rectangular bed, multiply inside length by inside width and the added soil depth, all in feet. To enter depth in inches, divide by 12:
A 4 × 8 ft bed filled to 10 in
4 ft × 8 ft × 10 in ÷ 12 = 26.67 ft³ of soil before extra allowance. Divide by 27 to get 0.99 yd³.
With an editable 10% allowance, the shopping estimate becomes 29.33 ft³, or about 1.09 yd³. At 2 ft³ per bag, round 29.33 ÷ 2 up to 15 whole bags.
For a top-up, subtract the current soil height from the target before multiplying. For example, a bed currently at 7 in and targeted for 10 in needs 3 in of added soil. If current soil already reaches the target, the calculated added volume is zero.
Compare the package you can buy
Read the volume printed on the bag. A bag's weight does not tell you its soil volume. For bulk soil, ask the supplier for its minimum order, cubic-yard increment, delivery charge, and any other fees. Round the needed volume to that supplier's ordering rules before comparing prices with bags. If you have more than one bed, add their soil volumes before rounding the purchase.
Check the estimate on site
Uneven bottoms, settling, mixed fill materials, and a different actual fill height can change what you need. This calculation estimates purchase volume; it does not choose a growing mix for a particular crop. Check local gardening guidance and the product label for soil selection.
Enter your own dimensions, bag size, and quotes in the raised bed soil calculator. Its breakdown shows the numbers for each bed. The calculation method explains unit conversions and whole-package rounding.
Source
Mississippi State University Extension: Constructing Raised Beds for the Mississippi Gardener describes measuring the growing mix by bed length, width, and depth. The bag and supplier examples above are worked purchasing examples, not product recommendations.