function calculateConcrete() {
// 1. Get input values
var length = parseFloat(document.getElementById('slab_length').value);
var width = parseFloat(document.getElementById('slab_width').value);
var thicknessInches = parseFloat(document.getElementById('slab_thickness').value);
var wastePercent = parseFloat(document.getElementById('waste_percent').value);
var pricePerYard = parseFloat(document.getElementById('price_per_yard').value);
// 2. Validate inputs
if (isNaN(length) || length <= 0) {
alert("Please enter a valid length in feet.");
return;
}
if (isNaN(width) || width <= 0) {
alert("Please enter a valid width in feet.");
return;
}
if (isNaN(thicknessInches) || thicknessInches 27 cubic feet in 1 cubic yard
var cubicYardsBase = cubicFeetBase / 27;
// Add Waste Factor
var wasteMultiplier = 1 + (wastePercent / 100);
var totalCubicFeet = cubicFeetBase * wasteMultiplier;
var totalCubicYards = cubicYardsBase * wasteMultiplier;
// Calculate Bag Estimates
// 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);
// Calculate Cost (Bulk)
var totalCost = totalCubicYards * pricePerYard;
// 4. Update UI
document.getElementById('res_yards').innerText = totalCubicYards.toFixed(2);
document.getElementById('res_feet').innerText = totalCubicFeet.toFixed(2);
document.getElementById('res_bags80').innerText = bags80;
document.getElementById('res_bags60').innerText = bags60;
// Format cost as currency
var formatter = new Intl.NumberFormat('en-US', {
style: 'currency',
currency: 'USD',
});
document.getElementById('res_cost').innerText = formatter.format(totalCost);
// Show results
document.getElementById('calc-results').style.display = 'block';
}
How to Calculate Concrete for Your Project
Whether you are pouring a patio, a driveway, or a foundation for a shed, accurately calculating the amount of concrete needed is crucial for project success. Ordering too little results in expensive second deliveries and potential "cold joints" in your slab, while ordering too much is a waste of money.
Expert Tip: Always calculate for a margin of safety. Ground surfaces are rarely perfectly level, and subgrades can settle. We recommend adding 5-10% to your calculation to account for spillage and uneven excavation.
The Concrete Formula
To calculate the volume of concrete required for a rectangular slab, you use the formula:
However, since most measurements are taken with thickness in inches, you must first convert the inches to feet by dividing by 12.
Once you have the total cubic feet, divide that number by 27 to get Cubic Yards, which is the standard unit of measurement for ordering from a ready-mix truck.
Pre-Mixed Bags vs. Ready-Mix Truck
Should you mix it yourself or order a truck? This calculator provides estimates for both.
Small Projects (Less than 1 Yard): For setting posts, small pads, or repairs, buying 60lb or 80lb bags of pre-mix (like Quikrete or Sakrete) is usually more economical.
Large Projects (More than 1-2 Yards): If your calculator shows you need more than 2 cubic yards, ordering a ready-mix truck is significantly easier and often cheaper per unit of volume than buying hundreds of bags.
Standard Slab Thicknesses
4 Inches: Standard for residential sidewalks, patios, and driveways used for passenger vehicles.
5-6 Inches: Recommended for driveways that hold heavy trucks, RVs, or hot tubs.
Calculating Bags of Concrete
If you are buying bags, the yield depends on the weight:
An 80lb bag typically yields approximately 0.60 cubic feet of cured concrete.
A 60lb bag typically yields approximately 0.45 cubic feet.
Our calculator automatically divides your total required volume by these yield figures to tell you exactly how many bags to pick up at the hardware store.