Garbage bag size
A kitchen can measuring 19 by 14.5 by 10.5 inches inside takes a 13-gallon kitchen bag. Measure the inside of your can, enter height, width and depth, and get the standard bag size that will drape over the rim. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Height
- 19
- Width
- 14.5
- Depth
- 10.5
- Can volume cu in
- 2,892.75
- Can volume gallons
- 12.5227272727
- Bag size gallons
- 13
- Bag label
- 13-gallon kitchen
Buying the right garbage bag is not a trip down the aisle with a tape measure and a shrug: the liner has to drape over the rim, sit inside the can without pooling on the floor, and still leave enough volume for a day's waste. This garbage bag size calculator takes the can's height, width, and depth as positive finite numbers in inches and returns the recommended trash-bag capacity in US gallons. Interior volume is height times width times depth divided by two hundred thirty-one — the exact cubic inches in one US liquid gallon — then the solver snaps that volume onto the next retail bag rating (four, eight, ten, thirteen, sixteen, twenty, thirty, thirty-three, thirty-nine, forty-five, fifty-five, or sixty gallons) with a small stretch allowance so a kitchen can that measures a hair over twelve gallons still gets a thirteen-gallon bag.
How recommended trash bag gallons are computed from the can
A rectangular trash can is a box. Its interior volume in cubic inches is height times width times depth, using the liner well — the floor of the can to the rim, and the opening left to right and front to back — not the exterior footprint that includes a lid, a pedal, or a decorative skirt. One US liquid gallon is defined as exactly two hundred thirty-one cubic inches, so the geometric can volume in gallons is that product divided by two hundred thirty-one.
That number is what people mean when they ask what size bag a can takes, but it is not yet the bag you should buy. Retail liners are sold on a fixed ladder: four-gallon wastebasket, eight-gallon bathroom, ten-gallon medium, thirteen-gallon kitchen, sixteen-gallon tall kitchen, twenty-gallon large kitchen, then thirty, thirty-three, thirty-nine, forty-five, fifty-five, and sixty for outdoor and commercial cans. The solver multiplies the geometric gallons by a fit ratio of ninety-two hundredths and then picks the smallest rating on that ladder that still covers the result.
The eight-percent slack exists because a bag stretches over the rim and because nobody fills a can to the mathematical brim; without it, a typical thirteen-gallon kitchen can that measures twelve and a half gallons inside would be pushed to a sixteen-gallon tall-kitchen SKU that bunches at the bottom. When the needed volume is larger than sixty gallons the recommendation is the ceiling of that needed volume, labelled as a custom size, so a cart or a wheeled toter still gets a number instead of a silent clamp.
What you can do with it
Kitchen step-can restock
Turn a 19-by-14.5-by-10.5-inch liner well into a 13-gallon kitchen bag before you buy a box at the store.
Bathroom and office wastebaskets
Size a 12-by-8-by-8-inch bathroom basket to a 4-gallon wastebasket liner instead of stretching a kitchen bag over a tiny rim.
FAQ
How do I calculate garbage bag size from a trash can?
Send positive height, width, and depth in inches.
What size trash bag for a 13-gallon kitchen can?
Taller wells that measure well above 13 gallons snap up to a 16-gallon tall-kitchen bag.
What happens if height, width, or depth is zero or negative?
Can dimensions must be positive finite numbers; zero, negative, missing, and non-numeric values are not billed.
Are the dimensions in inches or centimetres?
Inches. One US liquid gallon is exactly 231 cubic inches, and US trash bags are sold by that gallon. Convert centimetres to inches before you call.
Why does a can of just over 12 gallons get a 13-gallon bag and not a 16?
Because the bag only needs to cover about 92% of the can's volume: it stretches over the rim and nobody fills a can to the brim. A bigger bag would bunch at the bottom.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/life/garbage-bag-size \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"height":19,"width":14.5,"depth":10.5}'const res = await fetch("https://api.kit.forhosting.com/life/garbage-bag-size", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"height": 19,
"width": 14.5,
"depth": 10.5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/life/garbage-bag-size",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"height": 19,
"width": 14.5,
"depth": 10.5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/life/garbage-bag-size", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"height":19,"width":14.5,"depth":10.5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"height":19,"width":14.5,"depth":10.5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/life/garbage-bag-size", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"height": 19,
"width": 14.5,
"depth": 10.5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "life.garbage_bag_size",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
Zero, negative, missing, or non-finite dimensions fail with invalid_input and are not billed.
How recommended trash bag gallons are computed from the can
The contract is deterministic: the same three inches always produce the same bag_size_gallons, bag_label, can volume, and slack, which you can pin in a test or send to a purchasing sheet.
Input contract, response fields, and validation errors
All three must be strictly positive and are interpreted in inches. A typical kitchen well of nineteen by fourteen and a half by ten and a half inches returns a thirteen-gallon kitchen bag; a bathroom basket of twelve by eight by eight inches returns a four-gallon wastebasket. POST a JSON body with three required finite numbers: height, the interior height of the liner well; width, the left-to-right opening; and depth, the front-to-back opening. The fields also accept the short aliases h, w, and d, and the longer aliases can_height, can_width, and can_depth; the solver reads the first defined alias and reports errors against the canonical names so the web form can mark the right control. On success the body echoes the cleaned height, width, and depth, returns can_volume_cu_in and can_volume_gallons as the geometric capacity, and puts the recommendation in bag_size_gallons with a bag_label such as thirteen-gallon kitchen. fit_ratio restates the ninety-two-hundredths allowance; slack_gallons is the bag rating minus the can volume and may be a small negative when a snug kitchen liner is the right SKU. A formula string restates the two-hundred-thirty-one conversion and the retail ladder; a unit_note reminds clients that the inches-to-gallons contract is exact. Missing fields, empty strings, non-numeric tokens, NaN, Infinity, zero, and negative values all fail with invalid_input and a message that names the field; those failures are not billed. Successful API calls use the published base of $0.002 per item; the free browser path runs the same solve function without consuming prepaid balance.
Where a garbage bag size calculator earns its keep
Households standing in a hardware aisle with a new step-can need a number they can match to the printed gallon rating on a box, not a debate about whether a thirteen-gallon drawstring will cuff over a nineteen-inch well. Municipal waste desks and office-supply desks can pin the nineteen-by-fourteen-and-a-half-by-ten-and-a-half kitchen case in a buying guide instead of recalculating cubic inches by hand each time the copy is edited. Property managers and janitorial buyers who restock many identical restrooms can measure one basket and reuse the bag_size_gallons across a floor plate instead of guessing between eight and thirteen. Keep all three dimensions positive and finite, pin bag_size_gallons and can_volume_gallons in your tests, and you get a reproducible recommendation for a shopping list, a janitorial purchase order, a showroom tablet, or an edge worker without standing up a general packaging engine for a three-number household problem.
Integration use cases
Janitorial takeoff across a floor plate
Measure one outdoor or commercial can and reuse bag_size_gallons across matching bins so the purchase order matches the aisle rating.
Technical questions
What does the garbage bag size calculator cost?
The browser tool is free. API requests use prepaid KIT balance at $0.002 per successful call; invalid input is not billed.