How to Calculate a Container Loading Plan for Mixed Carton Sizes
You have one container to fill and a mixed pile of cartons: some large, some small, some that must stay upright, some heavier than others. You need a loading plan that actually fits — no floating boxes, no wasted cube, no cartons left on the dock.
Doing this by hand works for a handful of similar boxes. It falls apart the moment sizes differ, because the number of possible arrangements explodes. A 40-carton job with free rotation already has more candidate layouts than anyone can sketch on paper, and once you add stacking rules (“nothing heavy on top of the light cartons”) and rotation restrictions (“this side up”), manual planning turns into guesswork.
This guide walks through a repeatable method for calculating a container loading plan for mixed carton sizes using RSJ 3D Packer — from structuring your data, through submitting the problem, to reading and checking the result. The managed workflow (the web application) is the primary path here. If you want to see what the underlying service is doing, the API is covered along the way, but you never have to touch a raw protocol to get a plan.
What You Need Before You Start
Collect two datasets before you open any tool. Everything else follows from them.
Per carton type (SKU):
count— how many cartons of this size (defaults to 1 if omitted)width,height,depth— required, mapping to x/y/zweight— optional (Standard or Pro plan)itemClass— optional integer that controls stackingvertical— optional; setfalseif the carton must not be rotated out of its upright position (Standard or Pro plan)riskPointsandriskTypes— optional, for dangerous goods (Pro plan)id— optional, an identifier of your choosing
Per container:
width,height,depth— internal dimensions, requiredcount— how many containers of this type you can useweight— optional maximum load (Standard or Pro plan)allowedRiskPoints— optional (Pro plan)itemClass— optional
Account and plan. The free 30-day test exposes the full Pro feature set, which is the easiest way to work through this guide with real data. After the trial, multiple container sizes, weight limits and vertical-rotation control require Standard; dangerous goods (risk types and risk points) require Pro. Basic covers mixed item sizes only. Every plan — including the trial — gets the same 240-second solver budget per request.
Tools. A browser is enough for the application. No local installation is needed for the cloud version; on-premises and stand-alone deliveries exist for Windows 10/11 64-bit and Ubuntu Linux 64-bit (16 GB RAM, 4 GB hard disk).
Step 1: Gather and Structure Your Carton and Container Data
Pick one unit — centimetres are the practical default for cartons — and use it everywhere. Mixed units are the single most common cause of nonsense results: a plan that leaves two-thirds of the container empty because half your rows were entered in millimetres.
Then assign the semantic fields:
itemClassenforces stacking. An item is only ever placed on items of a lower or equal class. Give your heaviest, most rigid cartons class 1, medium cartons class 2, and fragile ones class 3.vertical: falsemarks “this side up” cartons. Without it, the solver is free to lay the carton on its side.riskTypes/riskPointsare for dangerous goods: each item carries risk types and risk points, each container carriesallowedRiskPoints, and a separateriskslist declares pairs of risk types that must not travel together.
A structured input for a mixed shipment looks like this:
{
"containers": [
{ "width": 48, "height": 47, "depth": 46, "count": 1, "weight": 2000, "allowedRiskPoints": 1000 }
],
"items": [
{ "width": 11, "height": 6, "depth": 6, "count": 51 },
{
"width": 7, "height": 8, "depth": 9, "count": 53,
"vertical": false, "itemClass": 1, "weight": 12
},
{ "width": 8, "height": 9, "depth": 10, "count": 57, "riskTypes": [1, 2], "riskPoints": 10 }
],
"risks": [{ "type1": 1, "type2": 2 }]
}
Note the shape: one object per size, with a count, not one object per physical box. Fifty-seven identical cartons are one line, not fifty-seven.
Step 2: Choose the Container and Set Its Limits
Enter the internal dimensions of the container, not the external ones. Trailer walls, door frames and corrugation eat real volume, and a plan built on external measurements will not close.
Then set the limits that describe your shipment rather than your box:
count— how many containers of this size you are willing to use. Give the solver room to work; it reports how many it actually needed.weight— the maximum load for the container. Useful when the cube fills before the weight limit, or vice versa.allowedRiskPoints— the maximum risk points the container may carry (Pro).- Multiple container sizes — if you have both 20-foot and 40-foot options, list them all. The solver decides which container each item goes into. This requires Standard or Pro.
One thing to plan around: every request gets a fixed 240-second solver budget. You do not tune it, and you do not wait longer for a better answer. For a typical mixed-SKU shipment that is plenty; for thousands of distinct sizes it is a signal to simplify your data (see troubleshooting).
Step 3: Submit the Problem to RSJ 3D Packer
The managed path. Open the application, enter or upload your container and item data, and run the solve. The service handles the optimisation and returns an interactive 3D view of the result. This is the workflow most planners should use.
If you want to experiment before committing data, the API sandbox is a live request-and-response playground with a 3D preview — you can paste the JSON from Step 1, send it, and inspect the plan without writing a line of code.
The automation path. For scheduled or high-volume planning, call the REST API directly. Base URL is https://3dpacker.rsj.de. The raw protocol is only relevant if you are building a custom integration — everything below is ordinary JSON over HTTPS.
Authenticate first. Log in to obtain a session, then send it as a bearer token on every call:
curl -s "https://3dpacker.rsj.de/user/you@example.com?hmac=<hmac>" \
-H "Accept: application/json"
The hmac is an HMAC-SHA256 hash of the e-mail address, computed on the server while you are logged in, so a stand-alone client copies it once. The response contains your user record and a session value. Sessions last about a day — fetch a fresh one rather than storing it long-term. (The browser application authenticates with cookies instead, which is what the API sandbox relies on.)
Then submit the problem:
curl -s -X POST "https://3dpacker.rsj.de/solve" \
-H "Authorization: Bearer session-1bc90169-1c83-443e-8ed7-b0328aaf78a5" \
-H "Content-Type: application/json" \
-d @mixed-cartons.json
Unknown keys in the request objects are ignored, so you can carry client metadata along — just be aware that a future field could collide with a key you invented.
Step 4: Read the Solution and Adjust
The response tells you four things: what was packed, where it went, how full each container is, and what did not fit.
{
"containers": [
{ "width": 48, "height": 47, "depth": 46, "count": 1, "used": 1, "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 }
]
}
(Abridged — the full response also carries a viewer URL and an API sandbox URL.)
How to read it:
packedItems— each entry has a container index (c) and an x/y/z position. That is the placement instruction for the loading crew.filled— fill percentage per container. If it is low, the constraint set is doing the damage, not the geometry.used/usedContainers— how many containers the plan consumed.unpackedItemsandremaining— what did not fit, with counts.
Two levers fix most low-fill or leftover situations. First, rotation: if a size is locked upright and the geometry is awkward, allowing rotation usually recovers significant volume. Second, itemClass: a class value that is too restrictive limits where the solver may place a carton.
Then open the viewer URL and look at the plan in 3D. It is interactive, and it is embeddable in an IFRAME, which is the quickest way to put the plan in front of a colleague or a customer. You can also download the solution as a GLB 3D model if you want it in another tool.
Step 5: Check the Plan Against Your Requirements
Before the plan goes to anyone, confirm these four properties — they are guarantees the solver upholds, so a violation means your input, not the algorithm.
- No floating items. Every packed item is supported by the item below it.
- Stacking classes hold. An item only ever sits on items of a lower or equal class.
- Weight and risk limits are respected. The container’s
weightandallowedRiskPointsare ceilings, not targets. - Everything is accounted for. Packed counts plus
remainingcounts should match what you sent in.
Then use the 3D viewer for the judgement calls a JSON payload cannot make: is the door end accessible, are the heavy cartons low, does the load sequence work for the people who will actually do it. If you are handing this off, the container loading plan verification checklist for supervisors walks through that review step by step.
Troubleshooting Common Issues
Items remain unpacked. Add container count, allow rotation for one or two sizes, or relax an itemClass. If a weight ceiling is the blocker, the unpacked list usually shows the heavier sizes.
Low fill percentage. Check vertical: false first — rotation restrictions cost the most volume. Then check weight and risk limits, which can reserve space the solver cannot use.
The solver runs out of its budget. The 240 seconds is fixed across all plans. Simplify: merge near-identical carton sizes, reduce the number of distinct SKUs, or split the shipment into two requests.
Authentication errors. Sessions expire after roughly a day. Request a fresh session value instead of caching one.
Results that look wrong. Almost always units or dimensions. Confirm every row is in the same unit and that width/height/depth map to x/y/z consistently.
FAQ
Can I calculate a loading plan for mixed carton sizes without software?
Manual calculation is possible for very few cartons, but with mixed sizes and constraints like rotation and stacking, it becomes impractical. Software like RSJ 3D Packer uses a neural network optimized through neuro-evolution to find a good packing plan within a 240-second budget.
How does RSJ 3D Packer handle cartons that cannot be rotated?
You set "vertical": false for items that must not be rotated out of their upright position. The solver will then keep them upright. This feature is available on Standard and Pro plans.
What if my container has a weight limit?
You can specify a maximum weight for each container. The solver will respect this limit. Weight limits are available on Standard and Pro plans.
Can I integrate the packing solver into my own system?
Yes, RSJ 3D Packer offers a comprehensive web service API. You can authenticate, send a POST /solve request with your items and containers, and receive a JSON response with the packing plan. The cloud version is also integrated into Google Sheets through an add-on. The free API trial is a good place to start if you want to test that path with Pro features enabled.
Conclusion: From Mixed Cartons to Optimized Plan
The method is four moves: structure your carton and container data with the right itemClass, vertical and risk fields; set the container limits that reflect reality; submit the problem; then read the fill percentage, unpacked list and 3D viewer before adjusting. Checking the result against the four solver guarantees takes a minute and saves a phone call from the loading dock.
The point of using RSJ 3D Packer here is that the optimisation itself — the part that is genuinely hard with mixed sizes — is handled for you. You describe the shipment, and the service returns positions, fill rates and a viewable 3D plan.
Start with the free 30-day trial, which exposes the Pro feature set including dangerous goods and multiple container sizes. Subscriptions are billed through Stripe, and you can cancel or change your card or plan from your account at any time. Then open the application or the API sandbox and calculate your first mixed-carton loading plan.
Related posts
- Free 3D Bin Packing API Trial: Test the Pro Features
- Automated Packing Plan Software for Logistics Companies
- Container Loading Plan Verification Checklist for Supervisors