To calculate the rimsize you require for your bin measure the circumference in either inches or millimetres and divide that by 2 ---- this is the bag rimsize you require. For square or rectangular bins add up the lengths of the four sides (again in inches or millimetres) and then divide that by 2