ForHosting KIT · Developer Utilities

Container Loading Calculator

The container loading calculator estimates the largest number of identical rectangular boxes that can fit in a rectangular shipping container.

● BetaFree · in your browser
Use it from WebAPIEmailTelegramApp soon

Enter the container's internal length, width, and height, then provide the matching outside dimensions of one box in the same measurement unit. The calculator checks every axis-aligned box orientation, counts complete boxes along all three container dimensions, and returns the best result. It is a quick, repeatable way to compare carton sizes, prepare shipment estimates, and catch dimensional assumptions before freight is booked.

Measure the usable container and the packed box

Use the container's clear internal dimensions, not its advertised external dimensions. Door openings, corrugations, refrigeration equipment, wheel wells, liners, and load-securing hardware can reduce usable space. Measure the box after it has been filled and closed because bulging panels, tape, straps, and protective corners may make a packed carton larger than its specification. Enter all six values in one consistent unit, such as millimetres, centimetres, inches, or feet; the calculator does not need to know the unit because it compares ratios. Each value must be a positive finite number. Zero, negative values, missing dimensions, text, and non-finite numeric values are rejected instead of producing a misleading shipment estimate. If operating clearance is required, subtract it from the container dimensions or add it to the box dimensions before calculation. This creates a conservative input that better reflects the actual loading plan and avoids treating every nominal millimetre as available space.

Understand how the maximum is calculated

A rectangular box can align with a rectangular container in six axis-aligned orientations. The calculator evaluates every permutation of box length, width, and height. For each orientation, it divides each container dimension by the corresponding oriented box dimension and rounds down to a whole number. Those three whole-number counts are multiplied to obtain the number of boxes in a uniform grid. The orientation with the largest product becomes the result. Along with maximum_box_count, the response reports how many boxes fit along the container length, width, and height, plus the selected oriented box dimensions. When multiple orientations produce the same count, the first stable orientation is returned, so identical input always gives identical output. The method permits turning boxes onto any face, but it does not mix orientations within one load. That distinction keeps the result transparent and fast while still finding the best complete rectangular grid among all six conventional rotations.

Use the estimate in a practical loading decision

Treat the result as a dimensional planning estimate rather than a certified loading instruction. Real loads may require pallets, slip sheets, dunnage, ventilation gaps, weight distribution, axle-load compliance, stacking limits, crush protection, hazardous-goods separation, or access space for handling equipment. Any of those constraints can reduce the usable count. A box may fit geometrically yet be unsafe to rotate because its contents must remain upright, so exclude prohibited rotations by calculating them separately outside this general six-orientation model or use the returned orientation as a review checkpoint. The calculator also does not claim that mixed-orientation packing, nesting, or irregular void filling cannot improve a load; it finds the best uniform axis-aligned grid. Use it early to compare carton designs and estimate order quantities, then validate the chosen layout with packaging, warehouse, carrier, and safety requirements. For automated quoting or repeated catalogue checks, the same deterministic calculation is available at $0.002 per request and produces consistent results from the same dimensions.

Compare carton designs

Test proposed box dimensions against the same container and see which design produces the highest uniform-grid count.

Estimate shipment capacity

Create an early quantity estimate before booking freight, while clearly separating dimensional capacity from weight and safety constraints.

Check product catalogue packaging

Run consistent calculations across packaged SKUs to flag cartons whose dimensions use container space inefficiently.

What does a calculation cost?

Each API request costs $0.002. The calculation uses fixed arithmetic and checks all six orientations.

Do the dimensions need a specific unit?

No. Use any length unit, but use the same unit for every container and box dimension.

Does the calculator rotate the box?

Yes. It tests all six axis-aligned assignments of box length, width, and height and returns the best uniform orientation.

Can it mix different box orientations in one container?

No. It calculates complete uniform grids. A mixed-orientation packing plan may sometimes fit more boxes.

Does the result account for weight limits or pallets?

No. The result is based only on dimensions. Deduct space for pallets and clearance, and separately verify weight, handling, stacking, and safety limits.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/ecom/container-loading

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/ecom/container-loading \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"container_length":1200,"container_width":235,"container_height":239,"box_length":60,"box_width":40,"box_height":30}'
{
  "container_length": 1200,
  "container_width": 235,
  "container_height": 239,
  "box_length": 60,
  "box_width": 40,
  "box_height": 30
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "ecom.container_loading",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Read the full KIT documentation →