Understanding Box Packing Calculations

Several premium WooCommerce shipping extensions use built-in box packers to determine which box or envelope best fits the items in an order. This guide explains how box packers work, how to configure product dimensions for accurate packing, and how to select or customize boxes.

How box packers work

↑ Back to top

Box packers evaluate the dimensions of available boxes and envelopes (using inner dimensions, if specified) along with the dimensions of all products in the cart. The packer attempts to fit the order into the fewest number of boxes. If a single box cannot hold all the items, the largest box those products can fit inside is packed first, and additional boxes are used for the remaining items.

In addition to dimensions, box packers consider the weight of the items and the maximum weight of available boxes and envelopes. This prevents overly heavy packages, as the packer does not fill boxes beyond their maximum weight limit. If an order is too heavy for a single box or envelope, multiple packages are used.

Box packer libraries

↑ Back to top

Some shipping extensions let you choose between two box packer libraries, each with a different approach to fitting items into packages:

  • Speed Packer: Primarily volume-based. After confirming that product dimensions are equal to or less than the box or envelope, this packer calculates the volume of the items (L × W × H) and compares it to the volume capacity of the package. Because it relies on math rather than spatial simulation, it is faster and uses fewer resources, especially with large quantities. However, volume-based calculations do not always match real-world packing, so you may need to adjust product or package dimensions for accurate results.
  • Accurate Packer: Primarily rotation-based. After confirming that product dimensions are equal to or less than the box or envelope, this packer rotates each product multiple times before placing it in a package, similar to fitting pieces together in a puzzle. With large quantities, these calculations are more intensive and slower than the Speed Packer, but the results are typically more accurate because the method mirrors how people pack boxes in practice.

Product dimensions vs. shipping dimensions

↑ Back to top

The most important factor for accurate shipping calculations is the data on each individual product page. To view and edit these values, open a product and select the Shipping tab. You will see fields for weight, length, width, and height, all displayed in the units configured under WooCommerce > Settings > General.

Product data Shipping tab showing weight and dimensions fields.
For variable products, shipping dimensions can be set on each variation. If a variation does not have its own dimensions, the parent product values are used.

Enter the shipping dimensions of the product — the size of the item as it will be packaged and shipped — not the product’s unpackaged measurements. Include any extra padding or protective material in these dimensions.

For example, consider a movie poster that measures 27″ wide, 41″ tall, and 0.01″ thick when laid flat. Entering those dimensions would require a box at least 27″ × 41″ × 0.02″, resulting in wasted space and an inflated shipping fee. Instead, you would roll the poster and place it in a tube. A rolled poster fits into a package approximately 27″ × 3″ × 3″, which represents a much more accurate shipping size.

Box selection

↑ Back to top

Most shipping extensions include default box sizes based on the carrier you select. You can find the standard box dimensions on each carrier’s website:

Note: Unless otherwise stated, box dimensions listed by carriers are outside dimensions. The interior space is slightly smaller due to the thickness of the cardboard walls. For example, a box listed as 12″ may have an interior dimension of approximately 11.75″, so a 12″ product would not fit. Choose a box size slightly larger than your product.

Use custom boxes

↑ Back to top

Some shipping extensions allow you to define your own boxes and envelopes. To add a custom box, measure both the exterior dimensions at their widest points and the interior dimensions, and record the maximum weight. Custom boxes are used alongside the default carrier boxes, not in place of them.

View the calculated boxes

↑ Back to top

All shipping extensions include a Debug mode that displays the information sent to and received from the carrier’s API, along with the boxes selected for each shipment. The output varies depending on the extension. For details, see the shipping extensions debug mode documentation.

Important: While debug mode is active, your customers can see the same debug information that you see. Disable debug mode when you are finished testing.

Questions and support

↑ Back to top

Do you still have questions and need assistance? 

This documentation is about the free, core WooCommerce plugin, for which support is provided in our community forums on WordPress.org. By searching this forum, you’ll often find that your question has been asked and answered before.

If you haven’t created a WordPress.org account to use the forums, here’s how.

  • If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the WooCommerce Marketplace.
  • Need ongoing advanced support or a customization built for WooCommerce? Hire a Woo Agency Partner.
  • Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.

If you weren’t able to find the information you need, please use the feedback thumbs below to let us know.

Use of your personal data
We and our partners process your personal data (such as browsing data, IP Addresses, cookie information, and other unique identifiers) based on your consent and/or our legitimate interest to optimize our website, marketing activities, and your user experience.