function calculateConcrete() {
// Get inputs
var length = parseFloat(document.getElementById('slabLength').value);
var width = parseFloat(document.getElementById('slabWidth').value);
var thick = parseFloat(document.getElementById('slabThickness').value);
var waste = parseFloat(document.getElementById('wasteFactor').value);
var costYard = parseFloat(document.getElementById('pricePerYard').value);
var costBag = parseFloat(document.getElementById('pricePerBag').value);
// Validation
if (isNaN(length) || isNaN(width) || isNaN(thick)) {
alert("Please enter valid dimensions (Length, Width, and Thickness).");
return;
}
// Defaults for empty costs
if (isNaN(waste)) waste = 0;
// Calculations
// 1. Calculate Base Cubic Feet
// Length (ft) * Width (ft) * Thickness (ft)
// Thickness is in inches, so divide by 12
var baseCuFt = length * width * (thick / 12);
// 2. Apply Waste Factor
var totalCuFt = baseCuFt * (1 + (waste / 100));
// 3. Convert to Cubic Yards (1 Yard = 27 Cubic Feet)
var totalCuYards = totalCuFt / 27;
// 4. Calculate Bags
// Typical yield: 80lb bag ≈ 0.60 cu ft
// Typical yield: 60lb bag ≈ 0.45 cu ft
var bags80 = Math.ceil(totalCuFt / 0.60);
var bags60 = Math.ceil(totalCuFt / 0.45);
// 5. Calculate Costs
var truckCostTotal = 0;
var bagCostTotal = 0;
if (!isNaN(costYard)) {
truckCostTotal = totalCuYards * costYard;
}
if (!isNaN(costBag)) {
bagCostTotal = bags80 * costBag;
}
// Update DOM
document.getElementById('resCuFt').innerText = totalCuFt.toFixed(2) + " ft³";
document.getElementById('resCuYards').innerText = totalCuYards.toFixed(2) + " yd³";
document.getElementById('res80lb').innerText = bags80 + " bags";
document.getElementById('res60lb').innerText = bags60 + " bags";
document.getElementById('resTruckCost').innerText = !isNaN(costYard) ? "$" + truckCostTotal.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) : "N/A";
document.getElementById('resBagCost').innerText = !isNaN(costBag) ? "$" + bagCostTotal.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2}) : "N/A";
// Show results
document.getElementById('result').style.display = 'block';
}
How to Calculate Concrete for Your Project
Whether you are pouring a simple backyard patio, a driveway, or footings for a new deck, determining the exact amount of concrete required is the most critical first step. Buying too little leads to "cold joints" and structural weaknesses, while buying too much is a waste of money.
This Concrete Slab Calculator uses the standard industry formula to convert your dimensional measurements into Cubic Yards (for ready-mix truck orders) and pre-mix bags (for DIY projects).
The Concrete Formula Explained
To calculate the volume of concrete needed, you must think in three dimensions. The math follows this sequence:
Step 1: Convert the slab thickness from inches to feet by dividing by 12. (e.g., 4 inches = 0.33 feet).
Step 2: Multiply Length × Width × Thickness (in feet) to get Cubic Feet.
Step 3: Divide the Cubic Feet by 27 to get Cubic Yards.
Recommended Slab Thickness
Choosing the right thickness is vital for the longevity of your slab:
4 Inches: The standard for residential sidewalks, patios, and garage floors used for passenger cars.
5-6 Inches: Recommended for driveways that host heavier vehicles (SUVs, trucks) or areas with poor soil conditions.
6+ Inches: Heavy-duty commercial aprons or structural foundations.
Why Include a Waste Factor?
In our calculator, we include a default "Waste/Spillage Margin" of 5%. This is crucial because concrete forms can bow under pressure, expanding the volume slightly. Additionally, spillage during the pour and uneven subgrades (the ground beneath the concrete) often require more material than a perfect mathematical box would suggest. For uneven ground, consider increasing the waste margin to 10%.
Truck vs. Bag Mix
As a general rule of thumb, if your project requires more than 1.5 to 2 Cubic Yards of concrete, it is usually more cost-effective and physically manageable to order a ready-mix truck delivery. For smaller projects (like setting fence posts or a small A/C pad), buying 60lb or 80lb bags from a hardware store is efficient.