function calculateConcrete() {
// 1. Get input values using standard variables
var length = parseFloat(document.getElementById('slabLength').value);
var width = parseFloat(document.getElementById('slabWidth').value);
var inches = parseFloat(document.getElementById('slabThickness').value);
var quantity = parseFloat(document.getElementById('slabQuantity').value);
var wastePercent = parseFloat(document.getElementById('wasteFactor').value);
var price = parseFloat(document.getElementById('pricePerYard').value);
// 2. Validate Inputs
if (isNaN(length) || isNaN(width) || isNaN(inches)) {
alert("Please enter valid numbers for Length, Width, and Thickness.");
return;
}
if (isNaN(quantity) || quantity 0) {
totalCost = cubicYards * price;
showCost = true;
}
// 4. Update DOM
document.getElementById('res-yards').innerHTML = cubicYards.toFixed(2) + " Cubic Yards";
document.getElementById('res-feet').innerHTML = totalCubicFeet.toFixed(2) + " ft³";
document.getElementById('res-80lb').innerHTML = bags80 + " Bags";
document.getElementById('res-60lb').innerHTML = bags60 + " Bags";
var costRow = document.getElementById('cost-row');
if (showCost) {
document.getElementById('res-cost').innerHTML = "$" + totalCost.toFixed(2);
costRow.style.display = "flex";
} else {
costRow.style.display = "none";
}
// Show result container
document.getElementById('concrete-result').style.display = "block";
}
How to Calculate Concrete for Slabs, Patios, and Driveways
Planning a new patio, driveway, or shed foundation requires accurate material estimation. Ordering too little concrete results in expensive "short load" fees or cold joints in your slab, while ordering too much is money poured down the drain. This concrete calculator helps you determine exactly how many cubic yards or pre-mix bags you need for your project.
The Concrete Formula
To calculate the volume of concrete required for a slab, use the following formula:
Note that thickness is usually measured in inches, so you must divide the inches by 12 to convert them to feet before multiplying. For example, a 4-inch slab is 0.33 feet thick.
Cubic Yards vs. Pre-Mix Bags
Once you have your volume in cubic feet, you need to convert it to the unit you will be purchasing:
Ready-Mix Truck (Cubic Yards): Divide your total cubic feet by 27. (e.g., 54 ft³ ÷ 27 = 2 Cubic Yards).
80lb Bags (Quikrete/Sakrete): One 80lb bag typically yields about 0.60 cubic feet. Divide your total cubic feet by 0.60.
60lb Bags: One 60lb bag yields approximately 0.45 cubic feet.
Recommended Thickness for Concrete Slabs
Choosing the right thickness is vital for the longevity of your project:
4 Inches: Standard for residential sidewalks, patios, and garage floors for passenger cars.
5-6 Inches: Recommended for driveways that handle heavier trucks, RVs, or heavy machinery.
Why Include a Waste Factor?
Professional contractors always include a "margin of safety" or waste factor, typically between 5% and 10%. This accounts for:
Spillage during the pour.
Uneven subgrade (dips in the ground) that require more concrete to level out.
Concrete remaining in the mixer or pump.
Our calculator automatically includes a default 5% waste factor to ensure you don't run short during your pour.