How to calculate cubic yards
Get every dimension into feet first, multiply length × width × depth to get cubic feet, then divide by 27 to get cubic yards. The 27 comes from a cubic yard being a cube 3 ft on each side (3 × 3 × 3). The step people get wrong is depth: a spread depth quoted in inches has to be divided by 12 before it goes into the formula, so 4 inches is 0.333 ft, not 4. This calculator handles that conversion for you when you set the depth unit to inches.
Cubic yards are how bulk material is quoted, delivered and priced in North America, which is why it is worth converting before you call a supplier. A useful sanity check: at 3 inches deep, one cubic yard covers roughly 100 ft²; at 6 inches deep it covers about half that. Order a little over your calculated figure rather than under, since most yards charge a flat delivery fee and a second load costs far more than the extra material. Materials that settle or compact, such as gravel and topsoil, need a further allowance on top of that. Some suppliers sell by weight instead of volume, in which case you will also need the material's density in tons per cubic yard to convert.
This is a geometric volume only. Compaction, settling, density and minimum-order or delivery charges vary by material and supplier; confirm the ordering unit before you buy.