function calculateConcrete() {
// 1. Get Inputs
var len = parseFloat(document.getElementById('drivewayLength').value);
var wid = parseFloat(document.getElementById('drivewayWidth').value);
var thick = parseFloat(document.getElementById('slabThickness').value);
var priceYard = parseFloat(document.getElementById('costPerYard').value);
var laborSqFt = parseFloat(document.getElementById('laborCostSqFt').value);
var waste = parseFloat(document.getElementById('wasteFactor').value);
// 2. Validation
if (isNaN(len) || isNaN(wid) || isNaN(thick) || isNaN(priceYard) || isNaN(laborSqFt)) {
alert("Please enter valid numbers for all fields.");
return;
}
// 3. Logic
// Calculate Area in Square Feet
var areaSqFt = len * wid;
// Calculate Volume in Cubic Feet (Thickness / 12 to convert inches to feet)
var volumeCuFt = areaSqFt * (thick / 12);
// Convert to Cubic Yards (27 cubic feet in 1 cubic yard)
var volumeCuYards = volumeCuFt / 27;
// Add Waste Margin
var totalYardsNeeded = volumeCuYards * (1 + (waste / 100));
// Calculate Bags (Premix) Logic
// One 80lb bag yields approx 0.6 cubic feet.
// One 60lb bag yields approx 0.45 cubic feet.
// Volume in CuFt needed (with waste)
var totalCuFtNeeded = volumeCuFt * (1 + (waste / 100));
var bags80 = Math.ceil(totalCuFtNeeded / 0.6);
var bags60 = Math.ceil(totalCuFtNeeded / 0.45);
// Costs
var concreteCost = totalYardsNeeded * priceYard;
var laborCost = areaSqFt * laborSqFt;
var totalCost = concreteCost + laborCost;
// 4. Update UI
document.getElementById('resArea').innerHTML = areaSqFt.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 0}) + " sq. ft.";
document.getElementById('resVolume').innerHTML = totalYardsNeeded.toFixed(2) + " cubic yards";
document.getElementById('resBags').innerHTML = bags80 + " bags";
document.getElementById('resBags60').innerHTML = bags60 + " bags";
document.getElementById('resMatCost').innerHTML = "$" + concreteCost.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resLaborCost').innerHTML = "$" + laborCost.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('resTotalCost').innerHTML = "$" + totalCost.toLocaleString(undefined, {minimumFractionDigits: 2, maximumFractionDigits: 2});
document.getElementById('concreteResult').style.display = 'block';
}
How to Estimate Concrete Driveway Costs
Installing a new concrete driveway or patio is a significant investment that adds durability and curb appeal to your property. However, miscalculating the amount of concrete needed—measured in cubic yards—can lead to expensive shortages or wasteful overages. This Concrete Driveway Cost Calculator helps homeowners and contractors estimate the precise volume of material required and the associated financial costs.
Understanding the Formula: Cubic Yards
Concrete is sold by volume, specifically by the Cubic Yard. To calculate this manually, you must convert all your dimensions into feet:
Step 1: Calculate Area (Length × Width = Square Feet).
Step 2: Convert Thickness to Feet (Inches ÷ 12).
Step 3: Calculate Volume in Cubic Feet (Area × Thickness in Feet).
Step 4: Convert to Cubic Yards (Cubic Feet ÷ 27).
For example, a 40ft x 20ft driveway that is 4 inches thick requires approximately 9.88 cubic yards of concrete before factoring in waste.
Why Include a Waste Factor?
Professional concrete finishers always order more material than the exact mathematical volume calls for. This "waste factor" or "margin of safety" accounts for:
Spillage during the pour.
Uneven subgrade (the ground isn't perfectly flat).
Forms bowing out slightly under the weight of the wet concrete.
We recommend a waste factor of 5% to 10% for standard projects. If your subgrade is very uneven or you are pouring on a slope, consider increasing this to 10-15%.
Slab Thickness: 4 vs. 6 Inches
The standard thickness for a residential driveway is 4 inches. This is sufficient for passenger cars and light trucks. However, if you plan to park heavy equipment, RVs, or large boats, you should increase the thickness to 5 or 6 inches. Increasing thickness from 4″ to 5″ increases your material cost by approximately 25%, but significantly boosts the load-bearing capacity of the slab.
Premix Bags vs. Ready-Mix Truck
If your project is small (under 1-2 cubic yards), using 60lb or 80lb premix bags from a hardware store is viable. However, for a full driveway, a ready-mix truck is essential. As shown in the calculator results, a standard driveway might require hundreds of bags, making manual mixing impossible. Use the "Cubic Yards" result to order from a local batch plant.