Measure the side of each piece. In the example, each piece is 2-by-2-by-2 inches.
Determine the volume of each individual product. Volume (V) is equal to height (H) times width (W) times length, V = H * W * L. So, the volume of each piece is 8 cubed inches (2 * 2 * 2).
Determine the volume of the total. If you shipped 100 pieces, you multiply the volume by 100. This gives you the total volume of 100 pieces as 800 cubic inches.
Divide the total number by an even number. Because you have 2-inch boxes, the interior measurements must be divisible by 2 or you will have wasted space. Because the total number is a whole hundred, 10 is a logical place to start. This leave you with 80.
Divide the remaining volume by 10 and you have the whole number 8. This means that 100, 2-inch cubed boxes will fit in a 10-by-10-by-8-inch carton.