function calculateConcrete() {
// 1. Get Inputs
var len = parseFloat(document.getElementById('slabLength').value);
var wid = parseFloat(document.getElementById('slabWidth').value);
var thick = parseFloat(document.getElementById('slabThickness').value);
var bagWeight = parseInt(document.getElementById('bagSize').value);
var waste = parseFloat(document.getElementById('wasteFactor').value);
var cost = parseFloat(document.getElementById('pricePerBag').value);
// 2. Validate Inputs
if (isNaN(len) || isNaN(wid) || isNaN(thick)) {
alert("Please enter valid numbers for Length, Width, and Thickness.");
return;
}
if (len <= 0 || wid <= 0 || thick 0) {
totalCost = bagsNeeded * cost;
showCost = true;
}
// 4. Update UI
document.getElementById('resVolumeFeet').innerHTML = totalCubicFeet.toFixed(2) + " cu. ft.";
document.getElementById('resVolumeYards').innerHTML = totalCubicYards.toFixed(2) + " cu. yd.";
document.getElementById('resBags').innerHTML = bagsNeeded + " (" + bagWeight + "lb bags)";
var resultDiv = document.getElementById('result');
resultDiv.style.display = "block";
if (showCost) {
document.getElementById('costRow').style.display = "flex";
document.getElementById('resCost').innerHTML = "$" + totalCost.toFixed(2);
} else {
document.getElementById('costRow').style.display = "none";
}
}
How to Calculate Concrete for Slabs
Planning a patio, driveway, or shed foundation requires precise measurements to ensure you order enough material without wasting money on excess. This Concrete Slab Calculator helps you determine exactly how many bags of premix (Quikrete, Sakrete, etc.) or cubic yards of ready-mix you need for your project.
The Concrete Calculation Formula
To calculate the volume of concrete required for a slab, you need to determine the volume in cubic feet and then convert it to the unit of sale (either bags or cubic yards).
Note: Since thickness is usually measured in inches, divide the inches by 12 to get feet. For example, a 4-inch slab is 0.33 feet thick.
Standard Slab Thickness Guidelines
Choosing the right thickness is critical for the durability of your project:
4 Inches: Standard for walkways, patios, and shed floors. Suitable for foot traffic and light loads.
5-6 Inches: Recommended for driveways that accommodate passenger vehicles or light trucks.
6+ Inches: Heavy-duty foundations or driveways for heavy machinery/RVs.
Understanding Bag Yields
If you are mixing concrete yourself using pre-bagged mix, knowing the yield is essential. Most manufacturers assume a density of roughly 133-150 lbs per cubic foot.
80lb Bag: Yields approximately 0.60 cubic feet.
60lb Bag: Yields approximately 0.45 cubic feet.
40lb Bag: Yields approximately 0.30 cubic feet.
For large projects exceeding 2 cubic yards (roughly 90 x 80lb bags), it is often more cost-effective and labor-efficient to order a ready-mix truck delivery rather than mixing bags by hand.
Why Include a Waste Factor?
Professional contractors always include a "margin of safety" or waste factor in their calculations. A standard 10% buffer accounts for:
Uneven subgrade (the ground isn't perfectly flat).
Spillage during mixing and pouring.
Variations in formwork (forms bowing out slightly under pressure).
It is far better to have 2 extra bags left over than to run out of concrete while the slab is half-poured and curing quickly!