Every DIY concrete project starts with the same question: how many cubic yards do I order? Ready-mix suppliers sell by the cubic yard, but we measure slabs in feet and inches. Here is a tiny, dependable formula you can drop into any project.
The math
- Measure length and width in feet.
- Convert the thickness (depth) from inches to feet:
inches / 12. - Multiply length x width x depth to get cubic feet.
- Divide by 27, because one cubic yard is 3 ft x 3 ft x 3 ft = 27 cubic feet.
cubic yards = (L ft x W ft x (D in / 12)) / 27 A small JavaScript helper
function concreteYards(lengthFt, widthFt, depthIn, waste = 0.1) { const depthFt = depthIn / 12; const cubicFeet = lengthFt * widthFt * depthFt; const yards = cubicFeet / 27; return +(yards * (1 + waste)).toFixed(2); } console.log(concreteYards(20, 10, 4)); // 2.72 The optional waste factor adds 10% for spillage, uneven subgrade and over-excavation, which is what most contractors recommend.
Worked example
A 20 ft x 10 ft patio slab poured 4 inches thick:
- Depth: 4 / 12 = 0.333 ft
- Volume: 20 x 10 x 0.333 = 66.7 cubic feet
- Yards: 66.7 / 27 = 2.47 cubic yards
- With 10% extra: about 2.72 cubic yards, so order 3 yards.
Edge cases worth handling
- Mixed units like 10 ft 6 in: convert to 10.5 ft before multiplying.
- Round up when ordering, since suppliers usually sell in quarter- or half-yard increments.
- For bagged concrete, one 80 lb bag yields roughly 0.6 cubic feet.
If you want to skip the code and just get a number (plus bag counts), try the CalcQuarry concrete calculator. It uses the same formula and also covers gravel, mulch and paver base.
![Why Object.keys(user) Returns string[], Not (keyof User)[]: TypeScript Means It](https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2q4w48b9bzs43tynyhsf.png)

