RSJ 3D Packer 3D bin packing, palletising and load optimisation

← All posts

2026-11-18

How to Calculate How Many Pallets You Need (Without Guessing)

How to Calculate How Many Pallets You Need (Without Guessing)
RSJ 3D Packer packing optimization item packer

How to Calculate How Many Pallets You Need (Without Guessing)

You have a shipment: 51 cartons at 11 × 6 × 6, 53 crates at 7 × 8 × 9 that must stay upright, 57 boxes at 8 × 9 × 10 that weigh 12 kg each. Someone in planning asks the only question that matters for the freight quote: how many pallets do we need?

The instinct is to add up the volume and divide. That answer is almost always wrong — usually too low, because it assumes every cubic centimetre of a pallet is usable and that nothing weighs anything. The reliable way to get a pallet count is to stop estimating and start packing: give the item list to a solver that returns an actual arrangement, then count the containers it used.

This article walks through that procedure step by step using RSJ 3D Packer. By the end you’ll have a pallet count you can defend with a 3D plan, not a spreadsheet guess.

Prerequisites: what you need before you start

  • An item list with width, height, depth and count for every distinct item type. Optionally: weight, itemClass, vertical, riskPoints, riskTypes.
  • Pallet or container dimensions — width, height, depth — plus how many of each type you have available. Optionally a maximum weight and allowedRiskPoints.
  • Access to RSJ 3D Packer. The free 30-day test exposes the full Pro feature set, so you can run dangerous-goods scenarios during the trial without buying anything.
  • JSON familiarity only if you use the API. The web UI is form-based; the API takes a JSON body.

Two terms to fix in your head before starting. width, height, depth map to x, y, z. And vertical: false means this item must not be rotated out of its upright position — the flag you need for anything that leaks, stacks, or has a this-side-up arrow on it.

Step 1: Gather and structure your item data

Group identical items. You do not send 51 separate cartons; you send one line with "count": 51. That’s the single biggest input-size reduction available to you, and it makes the data readable when you come back to it next quarter.

Only add the optional fields where they change the outcome:

  • weight — needed if the pallet has a maximum load. Without it, the solver only reasons about geometry.
  • itemClass — the stacking class. An item is only ever placed on items of a lower or equal class, which is how you keep heavy base goods at the bottom. (For the mechanics, see Stacking Constraints in Container Packing Explained.)
  • vertical: false — for anything that must stay upright.
  • riskTypes and riskPoints — dangerous goods. Risk types are integers; risk points accumulate against the container’s allowedRiskPoints.
  • id — any identifier you like, echoed back in the result so you can map packed items to your own SKUs.

The item block looks like this:

"items": [
  { "id": "carton-A", "width": 11, "height": 6, "depth": 6, "count": 51 },
  { "id": "crate-B", "width": 7, "height": 8, "depth": 9, "count": 53,
    "vertical": false, "itemClass": 1, "weight": 12 },
  { "id": "box-C", "width": 8, "height": 9, "depth": 10, "count": 57,
    "riskTypes": [1, 2], "riskPoints": 10 }
]

count defaults to one if you omit it — which is a quiet way to under-count a shipment, so always set it explicitly.

Step 2: Define your pallet or container types

A container is a box the solver may fill. Give it dimensions, a count of how many are available, and any limits:

"containers": [
  { "width": 48, "height": 47, "depth": 46, "count": 5,
    "weight": 2000, "allowedRiskPoints": 1000 },
  { "width": 40, "height": 40, "depth": 40, "count": 3, "weight": 1200 }
]

Two things worth knowing here:

  • Include every size you actually have. If you list a small and a large pallet type, the solver works within that pool and uses what fits the load rather than forcing everything onto the big pallet. Multiple container sizes require the Standard plan or higher once the free test ends.
  • The sizing doesn’t have to be exact. The solver works within a 240-second time budget per request, so a payload with dozens of item lines and several container types is well inside what it handles.

If any of your item types carry risk types, declare which pairs must never share a load:

"risks": [{ "type1": 1, "type2": 2 }]

risks is optional but it is the field that turns “these are hazardous” into “these two categories cannot travel together”. Dangerous-goods handling is a Pro feature; during the 30-day test you get it anyway.

Step 3: Run the packing optimization

Through the web UI

Open the application, load your item and container data into the form (or paste the JSON), and submit. The result comes back with the plan and an interactive 3D view.

Through the API

The API is a JSON REST interface rooted at https://3dpacker.rsj.de. Authentication is a two-step: fetch a session, then send it as a bearer token on every call.

# 1. Obtain a session (hmac is computed server-side while logged in)
curl "https://3dpacker.rsj.de/user/you@example.com?hmac=$HMAC"
# → response contains "session": "session-1bc90169-..."

# 2. Solve
curl -X POST https://3dpacker.rsj.de/solve \
  -H "Authorization: Bearer $SESSION" \
  -H "Content-Type: application/json" \
  -d @payload.json

From Python, the same flow with the payload assembled in code:

import json, os, requests

BASE = "https://3dpacker.rsj.de"
headers = {"Authorization": f"Bearer {os.environ['PACKER_SESSION']}"}

payload = {
    "containers": [
        {"width": 48, "height": 47, "depth": 46, "count": 5,
         "weight": 2000, "allowedRiskPoints": 1000}
    ],
    "items": [
        {"id": "carton-A", "width": 11, "height": 6, "depth": 6, "count": 51},
        {"id": "crate-B", "width": 7, "height": 8, "depth": 9, "count": 53,
         "vertical": False, "itemClass": 1, "weight": 12},
        {"id": "box-C", "width": 8, "height": 9, "depth": 10, "count": 57,
         "riskTypes": [1, 2], "riskPoints": 10},
    ],
    "risks": [{"type1": 1, "type2": 2}],
}

r = requests.post(f"{BASE}/solve", headers=headers, json=payload, timeout=260)
plan = r.json()

Sessions last roughly a day, so fetch a fresh one per run rather than storing it in a config file. Because unknown keys in request objects are ignored, you can attach your own metadata fields to items — just be aware a future field name could collide with one.

The full schema, including every optional field, is in the API reference and the machine-readable OpenAPI document. If you’d rather poke at a live request without writing code, the API sandbox sends requests from plain JavaScript and renders a 3D preview.

Step 4: Interpret the result to get your pallet count

The response gives you the count directly, plus the evidence behind it:

{
  "containers": [
    { "width": 48, "height": 47, "depth": 46, "count": 5, "used": 3,
      "filled": 76.77, "first": 0 }
  ],
  "items": [
    { "width": 11, "height": 6, "depth": 6, "count": 51, "vertical": true, "remaining": 0 },
    { "width": 8, "height": 9, "depth": 10, "count": 57, "remaining": 17 }
  ],
  "packedItems": [
    { "id": 0, "c": 0, "width": 11, "height": 6, "depth": 6, "x": 0, "y": 0, "z": 0 }
  ],
  "unpackedItems": [
    { "id": 2, "width": 8, "height": 9, "depth": 10, "weight": 0,
      "itemClass": 0, "count": 17 }
  ]
}

Read it in this order:

  1. usedContainers / the used field — that’s your pallet count. Three used means three pallets, not five.
  2. filled — the fill percentage per container. 76.77% on the pallets you used tells you there’s still a quarter of a pallet of slack; 99% tells you the load is tight and a dimension change will break it.
  3. unpackedItems — anything the solver could not place. If this array is empty, the count is final. If it isn’t, the count is a lower bound.
  4. packedItems — each item with its container index c and x/y/z position. This is what the viewer draws.

Open the viewer URL from the response and rotate the model. Numbers on a page tell you the count; the 3D view tells you whether the count is sensible — whether the heavy crates ended up at the bottom and whether the last pallet is a near-empty afterthought.

Step 5: Adjust and re-run if needed

Getting an answer is the easy half. Now tighten it:

  • Unpacked items left over? Raise count on a container type, or add a larger type to the pool, and re-run. Don’t shrink the shipment in the request to make the number look good.
  • Low fill percentage across many pallets? Try a smaller container type in the pool, or consolidate item counts. Six pallets at 40% is a purchasing mistake, not a packing result.
  • Testing a constraint? Flip vertical to true on a rotation-restricted item, or raise a container’s weight, and re-run the same payload. The delta in used containers tells you what that constraint actually costs you.
  • Sharing the outcome? Download the solution as a GLB 3D model and attach it to the internal thread or the customer quote.

Each run is a separate request against the same 240-second budget, so iterating on a payload costs you nothing but a few minutes.

How to confirm it worked

Before you commit to the number, check four things:

  • unpackedItems is empty. Every item type shows remaining: 0.
  • used matches what you’d tell the carrier. If three containers are used out of five available, the answer is three.
  • Per-container limits hold. If you set weight or allowedRiskPoints, no used container goes past them; if you set risks, incompatible types are not in the same container.
  • The geometry is sane in the viewer. Each packed item sits on the item below it — the plan contains no floating items — and items only sit on items of a lower or equal itemClass. For a fuller checklist, see How to Check a Packing Plan Is Feasible.

A sanity check against volume is still worth thirty seconds, if only to catch a data-entry error — a payload with a depth typed as 4.6 instead of 46 will produce a suspiciously large pallet count:

item_volume = 51*11*6*6 + 53*7*8*9 + 57*8*9*10        # cm³
pallet_volume = 48*47*46
print(item_volume / pallet_volume)  # rough lower bound, no stacking, no weight

If the solver’s answer is far below the volume estimate, you have a units or dimension error in the payload. If it’s modestly above — which is normal — trust the plan, not the division.

Troubleshooting common issues

Everything comes back unpacked. Usually a container that’s too small in one dimension, or a weight limit below the weight of a single item. Drop the weight limit and re-run; if items fit, the limit was the blocker.

A large tail of unpackedItems. Add container count first, then relax constraints — vertical: false is the most expensive one for tall goods, since it removes orientations the solver could otherwise use.

Dangerous goods won’t load. Check that the risks pairs match the actual riskTypes integers on your items, and that allowedRiskPoints on the container is above the sum of riskPoints you’re asking it to hold.

401 from the API. The session expired — it’s valid for about a day. Fetch a new one rather than reusing a stored token.

400 from the API. Required fields are missing. items and containers are mandatory; width, height and depth are mandatory on both. Unknown keys are ignored rather than rejected, so a typo in an optional field name fails silently — it won’t error, it just won’t apply.

FAQ

Can I calculate how many pallets I need without any software?

For a rough estimate, divide the total volume of your items by the volume of one pallet. However, this ignores stacking constraints, weight limits, and the fact that items may not fit efficiently due to shape. For mixed-size shipments, a packing optimizer like RSJ 3D Packer gives a reliable count.

What if my items have different dimensions and stacking rules?

Manual calculation becomes error-prone. RSJ 3D Packer accepts per-item dimensions, weights, stacking classes (itemClass), and rotation restrictions (vertical: false), and computes a feasible packing plan that respects these constraints.

How does RSJ 3D Packer handle weight limits and dangerous goods?

You can set a maximum weight per container and assign riskPoints and riskTypes to items. Containers have allowedRiskPoints, and the risks array defines incompatible risk type pairs. The solver ensures these constraints are met in the packing plan.

Is there a free way to try the pallet calculation?

Yes, RSJ 3D Packer offers a free 30-day test that exposes the Pro feature set, including dangerous goods handling. You can sign up on the application page and run your first packing problem immediately.

Conclusion

A pallet count is only useful if you can show your work. The procedure above gives you exactly that: structure the item list, define the container pool with real limits, solve, read used and unpackedItems, then iterate on the payload until nothing is left over. Two minutes of JSON beats an hour of arguing about volume factors — and the 3D plan settles the argument anyway.

The solver core is a neural network optimised through neuro-evolution, producing heuristically optimised plans within a 240-second budget, so treat the result as a very good feasible answer rather than a mathematical proof of optimality. For most freight decisions that distinction doesn’t matter; the difference between four pallets and five does.

Start with the free 30-day test on your next mixed shipment, and keep the payload file — it becomes the template for every quote after it.

Related posts

EU label: AI-generated content