Multiply the interior length by the interior width by the fill depth, all in feet, and buy that many cubic feet of mix. Measure the inside of the frame, not the outside, and measure to the line where the soil will actually stop, not to the top of the board. A bed everyone calls "4 by 8 and 10 inches deep" almost never holds the 26.7 cubic feet that nominal math gives you, or the roughly 1 cubic yard that follows from it. Measured honestly, that same bed usually lands closer to 20 or 23 cubic feet. The 10 to 20 percent settling allowance that gets repeated everywhere is already living inside that gap, which is why adding it on top of a brim-full number is how people end up with three or four unopened bags stacked against the garage wall.
The tape measure goes on the inside of the frame
I want you at the corner of the bed with the tape hooked on the inner face of one end board, reading across to the inner face of the other. Then do it again at the opposite end. Wooden frames are not square. Mine ran an inch and a half different between the two ends of the same box, and on a hot afternoon with the boards still drying, that gap can open wider. When the two numbers disagree, use the smaller one for the width and the smaller one for the length. You are not trying to flatter the bed. You are trying to know how much mix will disappear into it.
While you are down there, sight along the top edge. If one corner sits low because the ground under it settled, the soil will slope, and a sloped bed wastes volume at the low end and leaves roots high and dry at the other. That is a build problem, not a soil problem, but you need to know about it before you order anything.
Your ten-inch bed is not ten inches deep
The board height is not the depth. A 2x10 is 1.5 inches thick and 9.25 inches tall. Two 2x6s stacked are 11 inches, not 12. If your sides are 8-foot 2x10s and the end boards sit between them, your interior length is a full 8 feet but your interior width is 4 feet minus two board thicknesses, or 3.75 feet. Run it: 8 times 3.75 times 9.25 divided by 12 comes to about 23.1 cubic feet. Same bed, same lumber, and the number dropped by more than three and a half cubic feet just from measuring what is actually there.
Then decide where the mix stops. Leave an inch, maybe an inch and a half, of freeboard so water does not sheet straight off the top and mulch has somewhere to sit. Filling that same bed to 8 inches gives you 20 cubic feet. That is the number I would write on the pad. Twenty, not 26.7. On a bed this size that is the difference between a two-trip afternoon and one clean delivery.
Where the settling allowance actually comes from
Nothing in that 20 gets compacted by you. If you tamp the mix down you are wrecking the pore space you paid for, so fill in thirds, water each layer, and let it drain before the next one. The mix will drop anyway. Expect an inch or two over the first season, and understand what is causing it: organic matter decomposing, not soil disappearing. A mix built mostly on compost and peat settles hard. One with a real mineral fraction, topsoil or sand or grit, settles much less.
That is the honest version of the 10 to 20 percent rule. If you are filling with straight compost, you are at the top of that range. If you are blending in mineral soil, you are at the bottom, and on a small bed you may not need the buffer at all. What you should never do is take a brim-full figure, add 15 percent, and then also subtract for the freeboard you were never going to fill anyway. Do one or the other. Either buy to the practical fill line and hold back a bag for the top-off, or buy to the brim and expect to use all of it across the first season.
Roots are a separate question, and the answer is that they do not take volume away from you. A carrot is not a hole. A tomato transplant arrives with a root ball the size of your fist, which is nothing against 20 cubic feet. Plant displacement is a rounding error at fill time. It matters later, in year three, when the crowns and the woody stems have eaten into the headroom and you are deciding whether to top off or turn the whole thing over.
Cubic feet into bags, bags into a decision
Divide your total cubic feet by the bag size and round up. Twenty cubic feet is ten 2-cubic-foot bags, fourteen 1.5s, or twenty 1s. If you had gone with the nominal figure and then padded it, you would have been buying north of 30 cubic feet, and the surplus is a full wheelbarrow of mix with nowhere to live.
For anything over about a yard, divide the total by 27 and think in bulk. Twenty-six point seven cubic feet is 0.99 of a cubic yard, which is why the 4-by-8-by-10 bed has become the standard example. Twenty cubic feet is 0.74. Bulk sellers often work to a minimum, sometimes a yard, sometimes more, so the arithmetic can point you to bags even when bulk is cheaper per cubic foot. That is a delivery question, not a gardening question, and it belongs in the same calculation.
I keep a single row per bed in a plain spreadsheet: length, width, target depth, cubic feet, bag count. It takes ten minutes to set up and it has never once been wrong, because it is just the formula from above with the rounding already done. A raised bed soil calculator on a phone does the same job if you would rather not keep the file. What neither tool will do is notice that your frame is out of square, so the tape measure still comes first.
Depth is the dial that moves the number most
Length and width are fixed by the frame. Depth is the one variable you choose, and it swings the volume harder than anything else. Six inches carries lettuce, spinach, herbs, radishes, and bush beans. Eight to ten is what I would give tomatoes, peppers, and cucumbers. Carrots and parsnips want at least 12 inches of loose mix, and they want it loose the whole way down, which usually means a separate bed or a taller frame rather than a deeper fill in a shallow one.
Here is the part that catches city growers specifically. If the bed sits on pavement or on a roof, every one of those 12 inches has to be inside the box. If it sits on open ground, roots can push past the frame into the soil below, but in a city yard that soil is often compacted construction fill with maybe four inches of topsoil scraped over it. Counting on it is a gamble. Measure the frame, fill to the depth the crop needs, and treat whatever is underneath as a bonus rather than a plan.
Whatever you land on, write the number down and keep it. Mix does not vanish between seasons, it shrinks, and the following spring you will be topping off an inch or two rather than rebuilding. With the original figures on hand, that top-off is a two-bag errand. Without them, it is a guess, and guesses about soil are the expensive kind.