*Includes defined safety margin. Does not include labor or rebar.
function calculateConcrete() {
// 1. Get Input Values
var length = parseFloat(document.getElementById("slabLength").value);
var width = parseFloat(document.getElementById("slabWidth").value);
var thickness = parseFloat(document.getElementById("slabThickness").value);
var wastePercent = parseFloat(document.getElementById("wasteFactor").value);
var priceYard = parseFloat(document.getElementById("pricePerYard").value);
var priceBag = parseFloat(document.getElementById("pricePerBag").value);
// 2. Validate Inputs
if (isNaN(length) || isNaN(width) || isNaN(thickness)) {
alert("Please enter valid dimensions for Length, Width, and Thickness.");
return;
}
if (length <= 0 || width <= 0 || thickness <= 0) {
alert("Dimensions must be greater than zero.");
return;
}
// Set default values for optional pricing if empty
if (isNaN(wastePercent)) wastePercent = 0;
// 3. Calculation Logic
// Convert thickness to feet
var thicknessFeet = thickness / 12;
// Calculate cubic feet
var cubicFeetRaw = length * width * thicknessFeet;
// Add waste factor
var wasteMultiplier = 1 + (wastePercent / 100);
var totalCubicFeet = cubicFeetRaw * wasteMultiplier;
// Convert to Cubic Yards (1 yard = 27 cubic feet)
var cubicYards = totalCubicFeet / 27;
// Calculate Bags
// Average concrete weight = 145 lbs per cubic foot (approx)
// This can vary, but 145-150 is standard for pre-mix calculation
var totalWeightLbs = totalCubicFeet * 145;
var bags80 = Math.ceil(totalWeightLbs / 80);
var bags60 = Math.ceil(totalWeightLbs / 60);
// Calculate Costs
var costBulkTotal = 0;
var costBagsTotal = 0;
// 4. Update UI
var resultDiv = document.getElementById("resultsArea");
resultDiv.style.display = "block";
document.getElementById("displayCubicYards").innerHTML = cubicYards.toFixed(2) + " cu. yards (" + totalCubicFeet.toFixed(1) + " cu. ft)";
document.getElementById("displayBags80″).innerText = bags80 + " bags";
document.getElementById("displayBags60″).innerText = bags60 + " bags";
if (!isNaN(priceYard) && priceYard > 0) {
costBulkTotal = cubicYards * priceYard;
// Most ready-mix companies have minimums (often 3-4 yards), logic handles pure math here
document.getElementById("displayCostBulk").innerText = "$" + costBulkTotal.toFixed(2);
} else {
document.getElementById("displayCostBulk").innerText = "Enter price/yard";
}
if (!isNaN(priceBag) && priceBag > 0) {
costBagsTotal = bags80 * priceBag;
document.getElementById("displayCostBags").innerText = "$" + costBagsTotal.toFixed(2);
} else {
document.getElementById("displayCostBags").innerText = "Enter price/bag";
}
}
How to Estimate Concrete Slab Costs
Planning a patio, driveway, or shed foundation requires accurate material estimation to avoid running out of concrete mid-pour or overspending on unnecessary materials. This calculator determines exactly how much concrete you need in cubic yards and pre-mix bags based on your specific dimensions.
The Concrete Volume Formula
To manually calculate the volume of concrete required for a slab, you use the following geometric formula:
Volume = Length × Width × Thickness
However, since concrete is sold by the Cubic Yard but measurements are often taken in feet and inches, unit conversion is necessary:
Convert the thickness from inches to feet (divide by 12).
Multiply Length (ft) × Width (ft) × Thickness (ft) to get Cubic Feet.
Divide Cubic Feet by 27 to get Cubic Yards.
Example: A 10′ x 10′ patio that is 4 inches thick would be: 10 × 10 × 0.33 = 33 cubic feet. 33 / 27 = 1.22 cubic yards.
Bagged Concrete vs. Ready-Mix Truck
When should you mix it yourself versus ordering a truck?
Bagged Concrete (40lb, 60lb, 80lb): Best for small projects under 1 cubic yard (approx. 45-50 bags of 80lb mix). Examples include fence posts, small walkways, or landing pads. It is labor-intensive but cheaper for small volumes.
Ready-Mix Truck: Best for projects over 1 cubic yard. Although there is often a "short load" fee for small orders, the time saved and consistency of the mix usually outweigh the cost for driveways, garage floors, and large patios.
Standard Slab Thickness Guidelines
The thickness of your slab depends heavily on its intended use:
4 Inches: Standard for residential sidewalks, patios, and garage floors (for passenger cars).
5-6 Inches: Recommended for driveways that hold heavier trucks, RVs, or hot tubs.
Monolithic Pour: Edges may need to be 8-12 inches thick if they are load-bearing for a structure.
Why Add a Waste Factor?
Professional contractors always order 5-10% more concrete than the exact mathematical volume. This accounts for:
Uneven subgrade (dips in the ground).
Spillage during the pour.
Form bowing under the weight of wet concrete.
Running short during a pour can result in a "cold joint," which weakens the slab and looks unsightly. It is always cheaper to discard a small amount of leftover concrete than to pay for a second emergency delivery.