Please enter valid positive numbers for dimensions.
Total Volume Required:0 Cubic Yards
Volume in Cubic Feet:0 ft³
80lb Premix Bags Needed:0 Bags
60lb Premix Bags Needed:0 Bags
function calculateConcrete() {
// Retrieve inputs
var length = document.getElementById("slabLength").value;
var width = document.getElementById("slabWidth").value;
var depth = document.getElementById("slabDepth").value;
var waste = document.getElementById("wasteFactor").value;
var resultArea = document.getElementById("resultsArea");
var errorMsg = document.getElementById("errorMsg");
// Validation
if (length === "" || width === "" || depth === "" || isNaN(length) || isNaN(width) || isNaN(depth) || length <= 0 || width <= 0 || depth <= 0) {
errorMsg.style.display = "block";
resultArea.style.display = "none";
return;
}
// Parse numbers
var l = parseFloat(length);
var w = parseFloat(width);
var d = parseFloat(depth);
var wastePercent = parseFloat(waste) || 0;
// Logic: Convert all to feet
// Depth is in inches, so divide by 12
var depthInFeet = d / 12;
// Calculate Cubic Feet
var cubicFeet = l * w * depthInFeet;
// Apply Waste Factor
var totalCubicFeet = cubicFeet * (1 + (wastePercent / 100));
// Calculate Cubic Yards (1 Yard = 27 Cubic Feet)
var cubicYards = totalCubicFeet / 27;
// Calculate Bags
// Standard Yield: 80lb bag ~= 0.60 cubic feet
// Standard Yield: 60lb bag ~= 0.45 cubic feet
var bags80 = Math.ceil(totalCubicFeet / 0.60);
var bags60 = Math.ceil(totalCubicFeet / 0.45);
// Display Results
document.getElementById("resCuYards").innerText = cubicYards.toFixed(2);
document.getElementById("resCuFt").innerText = totalCubicFeet.toFixed(2);
document.getElementById("resBags80").innerText = bags80;
document.getElementById("resBags60").innerText = bags60;
// Show result div and hide error
errorMsg.style.display = "none";
resultArea.style.display = "block";
}
How to Calculate Concrete for Your DIY Project
Planning a new patio, walkway, or shed foundation requires accurate material estimation. One of the most common mistakes in DIY concrete projects is underordering materials, leading to "cold joints" or structural weaknesses. This Concrete Slab Calculator helps you determine exactly how much premix concrete you need, whether you are ordering a truck or buying bags from the hardware store.
Understanding the Formula
To calculate the concrete volume required for a slab, you need to calculate the volume in cubic feet and then convert it to cubic yards or bag counts. The basic formula is: