Landscape material calculators often look more complicated than they are. For
mulch, gravel, compost, soil, and similar materials, the core coverage formula
comes from one conversion:
One cubic yard equals 27 cubic feet.
From that fact, we can derive a calculator that works in both directions,
exposes its assumptions, and fits in a small browser component.
Deriving square feet per cubic yard
Suppose a layer is d inches deep. Convert that depth to feet:
depth in feet = d / 12
Area times depth gives volume, so the area covered by one cubic yard is:
area = 27 / (d / 12)
area = 324 / d
That gives the common coverage values:
| Depth | One cubic yard covers |
|---|---|
| 1 inch | 324 sq ft |
| 2 inches | 162 sq ft |
| 3 inches | 108 sq ft |
| 4 inches | 81 sq ft |
| 6 inches | 54 sq ft |
The complete reference table is available as a printable
cubic yard coverage chart,
including typical tons per yard and bag conversions.
Implementing both directions
A useful interface should answer two different questions:
- How much area will the material I have cover?
- How many cubic yards should I order for a known area?
The JavaScript is small:
export function areaCovered(cubicYards, depthInches) {
if (cubicYards <= 0 || depthInches <= 0) return 0;
return (cubicYards * 324) / depthInches;
}
export function cubicYardsNeeded(squareFeet, depthInches) {
if (squareFeet <= 0 || depthInches <= 0) return 0;
return (squareFeet * depthInches) / 324;
}
For example, two cubic yards at four inches deep cover:
2 * 324 / 4 = 162 square feet
The reverse calculation returns exactly two cubic yards:
162 * 4 / 324 = 2 cubic yards
Keep material density separate
Coverage by depth is a volume calculation. Converting cubic yards to tons is a
different operation because density changes by material, particle size,
moisture, and compaction.
Do not hide one arbitrary density inside the coverage formula. Accept density
as a separate input or configuration value:
export function tonsNeeded(cubicYards, tonsPerCubicYard) {
if (cubicYards <= 0 || tonsPerCubicYard <= 0) return 0;
return cubicYards * tonsPerCubicYard;
}
That separation makes assumptions visible and keeps the volume math reusable.
Convert cubic yards to bags without guessing
Bag count is another volume conversion, not a material-density conversion. If a bag is labeled in cubic feet, convert the required cubic yards to cubic feet and divide by the bag volume:
bags needed = (cubic yards * 27) / bag volume in cubic feet
For two cubic yards using 2-cubic-foot bags:
(2 * 27) / 2 = 27 bags
Round up only after the division because stores sell whole bags. A 1.5-cubic-foot bag, a 2-cubic-foot bag, and a 3-cubic-foot bag produce different counts even though the bulk volume is unchanged.
I use the same calculation in a free bags per cubic yard calculator. It supports common bag sizes, shows the unrounded math, and labels the output as a planning estimate.
Package it as a Web Component
I published the calculation data and a dependency-free custom element as the
open-source
@demi-valerith/yard-material-coverage-data
package. It can be loaded from npm or a versioned CDN URL:
<script
type="module"
src="https://cdn.jsdelivr.net/npm/@demi-valerith/yard-material-coverage-data@1.3.0/widget.js"
></script>
<yard-material-coverage
material="pea-gravel"
unit-system="imperial"
area="200"
depth="3"
></yard-material-coverage>
The element performs the calculation in the browser. It does not submit project
dimensions, create cookies, or require a framework. The
embed configurator
generates the markup and also provides WordPress, React, Astro, and plain HTML
examples.
Production details that matter
The formula is the easy part. A calculator becomes more trustworthy when it
also does the following:
- displays the selected depth and density assumptions near the result;
- keeps volume coverage separate from weight conversion;
- supports both forward and reverse calculations;
- rounds order quantities up only where ordering requires it;
- labels the result as a planning estimate rather than a final quote;
- keeps the answer available without client-only hidden content.
The dataset, methodology, examples, and component source are public so the
numbers can be reviewed instead of treated as a black box.
The useful abstraction is not a large calculator framework. It is one stable
volume identity, explicit material assumptions, and a small interface that can
be reused wherever readers need to answer “how much material do I need?”
``
Top comments (0)