The formula
volume (cu ft) = length (ft) × width (ft) × depth (in) ÷ 12
cubic yards = cubic feet ÷ 27
bags = cubic feet ÷ bag size (cu ft), rounded up
The conversions come from standard unit relationships: one cubic yard equals 27 cubic feet, and one cubic foot equals 1,728 cubic inches, or about 7.48 US gallons. Depth is entered in inches because that is how most fill-depth advice is written, so it is divided by 12 to convert to feet. If length and width are measured in inches, the calculator divides each by 12 as well.
Worked example: an 8 ft × 4 ft bed filled 12 inches deep holds 8 × 4 × 1 = 32 cubic feet, which is 32 ÷ 27 ≈ 1.19 cubic yards, or 16 bags of 2 cubic feet.
- Length (feet)
- Width: 4 feet lets the center be reached from both sides
- Depth: at least 12 inches recommended
- Volume = L × W × D
How deep and how wide
The University of Delaware Cooperative Extension recommends beds 4 feet wide, so the center can be reached from either side, and 4 or 8 feet long, with a depth of at least 1 foot to hold enough soil for a productive garden. Taller beds suit gardeners who have trouble bending or who garden from a wheelchair. UF/IFAS describes the standard square-foot-gardening bed as a 4 × 4 ft planting area, which is 16 cubic feet at 12 inches deep.
What to fill it with
| Option | Mix | Source |
|---|---|---|
| Topsoil–compost blend | "Good quality topsoil and compost blend", or a bagged raised-bed mix | University of Delaware |
| Equal parts | Topsoil, organic matter (well-rotted manure, compost or peat) and coarse sand | Iowa State University Extension |
| Simple ratio | About 70% topsoil and 30% compost | Iowa State University Extension |
| Square-foot style | Blended compost, or equal parts coarse vermiculite, peat moss and blended compost | UF/IFAS Gardening Solutions |
To split a total volume into parts, multiply: for a 32 cu ft bed at 70/30, that is about 22.4 cu ft of topsoil and 9.6 cu ft of compost. Home-made compost can supply part of that, but the EPA notes that a pile shrinks to about one-third of its original size by the time it is finished; bins, tumblers and the browns-to-greens mix are covered in composting in small spaces.
Bags versus bulk
UW–Madison Extension notes that bagged potting mixes are commonly sold in 1, 2 and 2.8 cubic foot sizes (7.5, 15 and 21 gallons), which is why those sizes are preset here. Check the label: some products list volume in quarts or liters instead. Bulk soil and compost are usually sold by the cubic yard, so the yard figure is the one to give a supplier.
Before building on paving or questionable ground, Delaware recommends testing the soil and using a barrier fabric (geotextile) over suspected contamination. Its material advice: cedar, cypress, recycled lumber, blocks or bricks; new pressure-treated wood is described as safe but not for organic gardening; and recycled tires or lumber treated with creosote or pentachlorophenol should not be used. The garden types overview compares raised beds with containers, in-ground beds and vertical gardens.
Sources
- LibreTexts Mathematics — Converting Units of Volume
- University of Wisconsin–Madison Extension — Growing Vegetables in Containers
- University of Delaware Cooperative Extension — Raised Bed Gardening (PDF)
- Iowa State University Extension Yard and Garden — What would be a good soil mix for a raised bed?
- UF/IFAS Gardening Solutions — Square Foot Gardening
- U.S. Environmental Protection Agency — Composting at Home
All sources were opened and checked in October 2026. Rules and figures change; confirm with the original before acting.
More in Containers, beds & layout
- Containers, beds and layout
Section overview: every page in this section.
- Companion planting chart, with the evidence
Common pairings with the evidence rating for each.
- Container sizes for vegetables
Minimum gallons and depth for 25 crops, two extension scales compared.
- Square foot gardening spacing
Plants per square foot for 35 crops from three charts.
- Growing tomatoes in containers
Pot size, compact cultivars, water, support, blossom end rot.
- The gardens: four small-space garden types compared
Raised beds, containers, in-ground and vertical side by side.