2D Bin Packing Algorithm

Recently, I needed to figure out how many 2D rectangles in different quantities I could fit in one large rectangle. (I actually needed to know how many 12″x12″, 10″x10″, 8″x8″, and 13″x8″ shooting targets I could cut out of a sheet of steel that is 315″x78″ in size while minimizing any leftover space.) I came across an algorithm online and modified it a bit to make it a easier to use and understand. Check it out at the link below.

2D Bin Packing Calculator

It turns out, I can get 97% utilization with the following sizes and quantities.