You need a 20" × 31" garbage bag size for an 8" × 12" × 22" bin. Here's how the calculation goes:
Sum the length and width of the trash can, i.e., 8 + 12 to get the garbage bag width of 20".
Sum the 22 height of your trash can with 5, i.e., a quarter of the garbage bag width, and 4" overhang to get your garbage bag height: 31".
Read more