function calculateConcrete() {
// 1. Get input values using var
var length = parseFloat(document.getElementById('slabLength').value);
var width = parseFloat(document.getElementById('slabWidth').value);
var thickness = parseFloat(document.getElementById('slabThickness').value);
var waste = parseFloat(document.getElementById('wasteFactor').value);
// 2. Validate inputs
if (isNaN(length) || isNaN(width) || isNaN(thickness)) {
alert("Please enter valid numbers for Length, Width, and Thickness.");
return;
}
if (isNaN(waste)) {
waste = 0;
}
// 3. Logic: Convert all to feet
// Thickness is in inches, so divide by 12
var thicknessFeet = thickness / 12;
// 4. Calculate Volume in Cubic Feet
var cubicFeet = length * width * thicknessFeet;
// 5. Apply Waste Factor
var totalCubicFeet = cubicFeet * (1 + (waste / 100));
// 6. Convert to Cubic Yards (27 cubic feet in 1 cubic yard)
var totalCubicYards = totalCubicFeet / 27;
// 7. Calculate Bags
// Standard yields: 80lb bag ~= 0.60 cubic feet, 60lb bag ~= 0.45 cubic feet
var bags80 = Math.ceil(totalCubicFeet / 0.60);
var bags60 = Math.ceil(totalCubicFeet / 0.45);
// 8. Update DOM
document.getElementById('resYards').innerText = totalCubicYards.toFixed(2);
document.getElementById('resFeet').innerText = totalCubicFeet.toFixed(2);
document.getElementById('resBags80').innerText = bags80;
document.getElementById('resBags60').innerText = bags60;
// 9. Show result box
document.getElementById('result').style.display = 'block';
}
How to Calculate Concrete for Slabs and Patios
Whether you are pouring a new patio, a driveway, or a shed foundation, calculating the correct amount of concrete is the most critical step in the planning process. Ordering too little results in "cold joints" and structural weaknesses, while ordering too much is a waste of budget. This Concrete Slab Calculator helps you determine exactly how many cubic yards or pre-mix bags you need for your project.
The Concrete Formula Explained
To calculate the volume of concrete required for a slab, you need to determine the volume in cubic feet and then convert that to cubic yards (the standard unit for ordering from ready-mix trucks).
The math works like this:
Step 1: Convert thickness from inches to feet (Divide inches by 12).
Step 2: Multiply Length × Width × Thickness (in feet) to get Cubic Feet.
Step 3: Divide Cubic Feet by 27 to get Cubic Yards.
Example: A 10ft x 10ft patio that is 4 inches thick involves multiplying 10 × 10 × 0.33 (4/12) = 33 cubic feet. Dividing 33 by 27 equals approximately 1.22 cubic yards.
Why Include a Waste Margin?
Our calculator includes a field for "Waste Margin." Professional contractors typically add 5% to 10% to their order. This accounts for:
Spillage during the pour.
Uneven subgrade (dips in the ground make the slab thicker in spots).
Concrete remaining inside the pump or mixer.
It is always cheaper to order slightly more concrete than to pay for a "short load" fee for a second truck to finish a small missing section.
Bags vs. Ready-Mix Truck
Should you mix it yourself or call a truck? As a general rule of thumb:
Under 1 Cubic Yard: Use pre-mix bags (60lb or 80lb). It is labor-intensive but cost-effective for small pads.
Over 1 Cubic Yard: It is usually better to order ready-mix delivery. Mixing over 45 bags of concrete by hand is physically exhausting and difficult to finish before the concrete begins to cure.
Standard Slab Thicknesses
4 Inches: Standard for residential patios, sidewalks, and shed floors.
5-6 Inches: Recommended for driveways that hold passenger vehicles or hot tub pads.
6+ Inches: Required for heavy equipment or commercial applications.