/* Calculator Container Styling */
#concrete-calculator-wrapper {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
max-width: 800px;
margin: 20px auto;
padding: 20px;
background: #f9f9f9;
border: 1px solid #e0e0e0;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
#concrete-calculator-wrapper h2 {
color: #333;
text-align: center;
margin-bottom: 25px;
}
/* Grid Layout for Inputs */
.calc-grid {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 20px;
}
.calc-input-group {
flex: 1 1 200px;
display: flex;
flex-direction: column;
}
.calc-input-group label {
font-weight: 600;
margin-bottom: 8px;
color: #555;
}
.calc-input-group input, .calc-input-group select {
padding: 10px;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 16px;
}
.calc-input-group input:focus {
border-color: #0073aa;
outline: none;
}
/* Button Styling */
.calc-btn-row {
text-align: center;
margin-top: 10px;
}
button#calculateBtn {
background-color: #0073aa;
color: white;
border: none;
padding: 12px 30px;
font-size: 18px;
font-weight: bold;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
button#calculateBtn:hover {
background-color: #005177;
}
/* Results Section */
#calc-results {
margin-top: 30px;
background: #fff;
padding: 20px;
border-left: 5px solid #0073aa;
border-radius: 4px;
display: none; /* Hidden by default */
}
.result-row {
display: flex;
justify-content: space-between;
padding: 10px 0;
border-bottom: 1px solid #eee;
}
.result-row:last-child {
border-bottom: none;
}
.result-label {
color: #666;
}
.result-value {
font-weight: bold;
color: #222;
font-size: 1.1em;
}
.highlight-result {
color: #0073aa;
font-size: 1.3em;
}
/* Content Styling */
#calculator-content {
max-width: 800px;
margin: 40px auto;
line-height: 1.6;
color: #333;
font-family: inherit;
}
#calculator-content h2 {
margin-top: 30px;
color: #222;
}
#calculator-content h3 {
color: #444;
}
#calculator-content ul {
margin-bottom: 20px;
}
#calculator-content li {
margin-bottom: 10px;
}
.error-msg {
color: #d63638;
font-weight: bold;
text-align: center;
margin-top: 10px;
display: none;
}
function calculateConcrete() {
// 1. Get input values by ID
var len = document.getElementById("slabLength").value;
var wid = document.getElementById("slabWidth").value;
var dep = document.getElementById("slabDepth").value;
var qty = document.getElementById("slabQuantity").value;
var waste = document.getElementById("wasteFactor").value;
// 2. Validate Inputs
var errorDiv = document.getElementById("errorDisplay");
var resultsDiv = document.getElementById("calc-results");
// Convert to floats
var lengthFt = parseFloat(len);
var widthFt = parseFloat(wid);
var depthIn = parseFloat(dep);
var quantity = parseFloat(qty);
var wastePercent = parseFloat(waste);
// Check for NaN or negative numbers
if (isNaN(lengthFt) || lengthFt <= 0 ||
isNaN(widthFt) || widthFt <= 0 ||
isNaN(depthIn) || depthIn <= 0 ||
isNaN(quantity) || quantity <= 0) {
errorDiv.style.display = "block";
resultsDiv.style.display = "none";
return;
}
errorDiv.style.display = "none";
// 3. Perform Calculations
// Convert depth to feet (inches / 12)
var depthFt = depthIn / 12;
// Calculate Volume in Cubic Feet for ONE item
var volPerItem = lengthFt * widthFt * depthFt;
// Multiply by Quantity
var totalVolFt = volPerItem * quantity;
// Add Waste Percentage
// Formula: Total * (1 + (percentage / 100))
var totalVolWithWaste = totalVolFt * (1 + (wastePercent / 100));
// Convert to Cubic Yards (1 Yard = 27 Cubic Feet)
var totalYards = totalVolWithWaste / 27;
// Calculate Bags
// Typical yields:
// 80lb bag ~= 0.60 cubic feet
// 60lb bag ~= 0.45 cubic feet
// 40lb bag ~= 0.30 cubic feet
var bags80 = Math.ceil(totalVolWithWaste / 0.60);
var bags60 = Math.ceil(totalVolWithWaste / 0.45);
var bags40 = Math.ceil(totalVolWithWaste / 0.30);
// 4. Update Output Elements
document.getElementById("resYards").innerHTML = totalYards.toFixed(2) + " yd³";
document.getElementById("resFeet").innerHTML = totalVolWithWaste.toFixed(2) + " ft³";
document.getElementById("resBags80").innerHTML = bags80 + " bags";
document.getElementById("resBags60").innerHTML = bags60 + " bags";
document.getElementById("resBags40").innerHTML = bags40 + " bags";
// Show results
resultsDiv.style.display = "block";
}
How to Calculate Concrete for Slabs and Footings
Whether you are pouring a patio, a driveway, or footings for a deck, knowing exactly how much concrete to order is crucial for the success of your project. Ordering too little can result in a "cold joint" which weakens the structure, while ordering too much wastes money. Our Concrete Calculator helps you estimate the precise volume needed in cubic yards and converts that into the number of pre-mix bags required for smaller DIY projects.
The Concrete Formula
To calculate the concrete volume manually, you need to determine the cubic footage of the area. The standard formula is:
Length (ft) × Width (ft) × Depth (ft) = Volume in Cubic Feet
Since most people measure depth in inches, you must first convert the inches to feet by dividing by 12. For example, a 4-inch slab is 0.33 feet thick.
To convert Cubic Feet to Cubic Yards (which is how ready-mix trucks measure orders), divide the total cubic footage by 27.
Calculating Bags of Concrete
For smaller projects where a cement truck isn't necessary, you will likely use pre-mixed bags (like Quikrete or Sakrete). The yield of these bags depends on their weight:
- 80lb Bag: Yields approximately 0.60 cubic feet.
- 60lb Bag: Yields approximately 0.45 cubic feet.
- 40lb Bag: Yields approximately 0.30 cubic feet.
Example: If your project requires 10 cubic feet of concrete, you would need roughly 17 bags of 80lb mix (10 / 0.60 = 16.66).
Why Include a Waste Factor?
In construction, it is industry standard to add a safety margin or "waste factor" to your calculation. Spillage, uneven subgrades, and form bowing can all increase the actual amount of concrete needed. We recommend adding:
- 5%: For perfectly rectangular, flat forms on a level grade.
- 10%: For irregular shapes or uneven ground conditions.
Common Concrete Depths
- 4 Inches: Standard for sidewalks, patios, and residential driveways (passenger cars).
- 5-6 Inches: Required for heavier duty driveways (trucks/SUVs) or hot tub pads.
- 12+ Inches: Typical for structural footings.
Use the calculator above to plan your project accurately and ensure you have the right materials on site before you start mixing.