Use the formula for the bin opening shape
For a rectangular bin, flat bag width equals bin length plus bin width; a square is the same formula with equal sides. For a round bin, flat bag width equals diameter multiplied by π and divided by 2. These widths are half the opening perimeter because a flat bag has two layers.
Add bin height, bottom coverage, and overhang
Bag length equals bin height plus the overhang or tie allowance plus enough material to cross half the bin opening. For rectangles and squares, the bottom allowance is one quarter of the flat bag width. For circles, it is half the diameter. Purchase rounding is applied only after the minimum dimensions are calculated.
Check the bag construction and real fit before buying
The estimate assumes a conventional flat bag and simple bin geometry. Rim thickness, taper, handles, liners, lids, side gussets, star seals, drawstrings, elastic tops, unusually bulky contents, and manufacturer dimension conventions can change the fit. Choose a marketed size at least as large as both rounded dimensions and test the bag on the actual bin when fit matters.