About the Garbage Bag Size Calculator
This calculator turns a trash can's measurements into the trash bag dimensions that will actually fit it. It uses the same measure-and-convert method described by most bag manufacturers: measure the can's height and the diameter of its top opening (or the width and depth for a rectangular can), then derive the flat bag width, the bag length, the can's approximate holding capacity in gallons, and the closest standard retail bag size.
The formulas
For a round can with top diameter D and height H:
- Bag width = (π × D) ÷ 2 — half the rim's circumference, since a flat bag's two layers together wrap the full circle when opened.
- Bag length = H + (D ÷ 2) + overhang — the can's height, plus roughly a radius of extra material to cover the rounded bottom and rim, plus a few inches of overhang to gather and tie.
- Capacity (gallons) = (π × r² × H) ÷ 231, where r = D ÷ 2 and 231 cubic inches equal one US gallon.
For a rectangular can with top width W and depth Dp, the calculator swaps the circle formulas for their rectangular equivalents:
- Bag width = (2 × W + 2 × Dp) ÷ 2 = W + Dp — half the full perimeter of the opening.
- Bag length = H + ((W + Dp) ÷ 2 ÷ 2) + overhang, using the average of width and depth in place of the diameter.
- Capacity (gallons) = (W × Dp × H) ÷ 231, the box volume converted from cubic inches to gallons.
The calculated capacity is then matched to the closest common retail size — 4, 8, 13, 20, 30, 33, 39, 45, 55, or 65 gallons — so you know which box to reach for at the store.
Why the calculated capacity often runs larger than the printed bag size
A can's geometric volume assumes you fill it all the way to the brim. Retail bag sizes like "13 gallon" or "30 gallon" are nominal trade sizes that leave slack for gathering the bag, tying it off, and not overstuffing — so a bag rated somewhat below your can's full geometric volume will often still fit comfortably in practice.
How to get the best results
- Measure the inside height of the can, not the outside, and measure to the top rim, not to a lid.
- For round cans, measure the diameter straight across the widest point of the opening, not the circumference.
- If the can tapers (wider at top than bottom), use the top opening measurement — that is what the bag has to stretch over.
- Leave at least 2–4 inches of tie overhang so you have enough material to gather and knot the bag when it is full.