function calculateConcrete() {
// Get input values
var length = parseFloat(document.getElementById('concLength').value);
var width = parseFloat(document.getElementById('concWidth').value);
var depth = parseFloat(document.getElementById('concDepth').value);
var waste = parseFloat(document.getElementById('concWaste').value);
var price = parseFloat(document.getElementById('concPrice').value);
// Validation
if (isNaN(length) || isNaN(width) || isNaN(depth)) {
alert("Please enter valid numbers for Length, Width, and Thickness.");
return;
}
if (isNaN(waste)) { waste = 0; }
// Logic: Calculate Cubic Feet first
// Formula: Length (ft) * Width (ft) * (Depth (in) / 12)
var cubicFeetRaw = length * width * (depth / 12);
// Add Waste Percentage
var wasteFactor = 1 + (waste / 100);
var totalCubicFeet = cubicFeetRaw * wasteFactor;
// Convert to Cubic Yards (27 cubic feet in 1 cubic yard)
var totalCubicYards = totalCubicFeet / 27;
// Calculate Bags
// Approx yields: 80lb bag = 0.60 cu ft, 60lb bag = 0.45 cu ft
var bags80 = totalCubicFeet / 0.60;
var bags60 = totalCubicFeet / 0.45;
// Update DOM
document.getElementById('resFeet').innerHTML = totalCubicFeet.toFixed(2) + " ft³";
document.getElementById('resYards').innerHTML = totalCubicYards.toFixed(2) + " yd³";
document.getElementById('resBags80').innerHTML = Math.ceil(bags80) + " bags";
document.getElementById('resBags60').innerHTML = Math.ceil(bags60) + " bags";
// Calculate Cost if price is provided
if (!isNaN(price) && price > 0) {
var totalCost = totalCubicYards * price;
document.getElementById('resCost').innerHTML = "$" + totalCost.toFixed(2);
document.getElementById('costRow').style.display = 'flex';
} else {
document.getElementById('costRow').style.display = 'none';
}
// Show result box
document.getElementById('resultBox').style.display = 'block';
}
How to Calculate Concrete for Slabs and Footings
Planning a new driveway, patio, or walkway? Accurately estimating the amount of concrete you need is the first step to a successful project. Ordering too little leads to expensive emergency deliveries and "cold joints" in your slab, while ordering too much is a waste of money.
The Concrete Formula
Concrete is measured by volume, specifically in Cubic Yards (often just called "yards"). The basic math formula to determine the volume of a rectangular slab is:
Length (ft) × Width (ft) × Thickness (ft) = Cubic Feet
Then divide by 27 to get Cubic Yards.
Note: Since thickness is usually measured in inches, remember to divide the inches by 12 before multiplying.
Standard Thickness Guides
4 Inches: Standard for residential sidewalks, patios, and garage floors (light vehicle traffic).
5-6 Inches: Recommended for driveways holding heavier vehicles, RV pads, or areas with poor soil conditions.
8+ Inches: Heavy-duty commercial aprons or structural footings.
Why You Need a Waste Margin
Professional contractors never order the exact mathematical amount. Site conditions vary—your subgrade might be slightly uneven, forms might bow out under pressure, or spillage may occur during the pour. We recommend adding a 5% to 10% safety margin to your total volume to ensure you don't run short.
Bags vs. Ready-Mix Truck
When should you mix it yourself versus calling a truck?
Use Bags (60lb/80lb): For small projects requiring less than 1 cubic yard (approx. 45 bags of 80lb mix). Ideal for setting fence posts or small landing pads.
Order a Truck: For anything over 1 cubic yard. Mixing 50+ bags by hand is labor-intensive and makes it difficult to achieve a consistent finish before the concrete begins to set.
FAQ: How many bags make a yard?
To make one cubic yard of concrete, you generally need: