DEV Community

Cover image for Why Your Shipping Costs Don't Match Your Product Weight (And How to Fix It)
Fazeel Khalid
Fazeel Khalid

Posted on

Why Your Shipping Costs Don't Match Your Product Weight (And How to Fix It)

Had a client ask me this a while back: why is a shipping quote for a lightweight product almost identical to one for something 5x heavier? Turns out it's not a bug in their carrier's system, it's just how parcel pricing works, and most people never run into the term until it's already costing them money.

The thing carriers actually bill you on is whichever is bigger: your package's real weight, or its "dimensional weight," which is basically volume dressed up as weight. Take length times width times height, divide by a divisor the carrier picks, and that's your DIM weight. If that number beats your actual weight, that's what you pay for.

DIM weight = (L x W x H) / divisor
you get billed on = max(actual weight, DIM weight)
Enter fullscreen mode Exit fullscreen mode

Makes sense once you think about it from the carrier's side. A truck runs out of floor space way before it runs out of weight capacity, so they charge for the space a box eats up, not just what's inside it.

Here's the bit that trips people up though: shrinking the box isn't automatically a win. It only helps if DIM weight was the thing governing your bill in the first place. Plenty of shipments are already priced on actual weight, and in that case a smaller box just... doesn't change anything. So "use smaller boxes" as blanket advice is kind of lazy. The actual question is which of your shipments are DIM-governed to begin with, because that's where the money is.

This is fine to handle manually when you're shipping a handful of orders a day. Somebody eyeballs the product, grabs a box that looks about right, done. It stops being fine once you're doing a few hundred orders a day, because now you've got different packers making different calls on the same SKU, and that inconsistency quietly adds up over a year.

That's basically the whole reason cartonization software exists, it's just doing the box-selection math for you, item by item, before anyone touches a box. I work on P4P, an API that does this (plus palletization, container loading, and truck loading, same engine underneath). One endpoint, you send it items and containers, it sends back the smallest carton that actually fits:

POST /api/pack
{
  "items": [
    { "name": "Electric Kettle", "length": 8, "width": 8, "height": 12, "quantity": 40, "weight": 3.5 }
  ],
  "containers": [
    { "name": "24x18x18 Box", "length": 24, "width": 18, "height": 18 }
  ],
  "optimizeBy": "volume"
}
Enter fullscreen mode Exit fullscreen mode

You can hit it without an API key at 1 req/min if you just want to poke at it, and there's a sandbox with a 3D viewer so you can actually see the packing instead of squinting at coordinates.

I wrote up a longer version of this with more on why DIM charges creep up over time and how to tell if your shipments are actually DIM-governed: How to Reduce Dimensional Weight Charges.

Anyway, curious if others here have dealt with this. Did you build something in-house for it or just eat the cost?

Top comments (0)