pallet_fitting_calculator
Calculate how many identical boxes fit onto a pallet by optimizing box orientation and stacking within height and weight limits.
Instructions
Calculate how many identical boxes fit on a pallet: boxes per layer (trying 90-degree rotation when allowed), layer count within the max height, totals, volume utilisation and weight capping.
Behavior: deterministic geometric packing of one box size in aligned rows and columns — it does not model interlocked or mixed-orientation patterns; weight_limited reports when max_payload_kg caps the count below the geometric fit; pallet_deck_height_cm defaults to 15. Missing or non-positive dimensions error naming the parameter. Rate-limited (anonymous use: 25 requests/day per IP): a 429 error body carries retry_after_seconds and a Retry-After header — back off and retry, or call get_subscribe_link for higher limits.
Returns: boxes_per_layer, layers, total_boxes, orientation, boxes_per_row/col, usable_height_cm, utilisation_percent, total_box_volume_cbm, wasted_space_cbm and the weight fields under result, plus confidence, _source and citation (the FreightUtils v1 response envelope).
Limitations: a theoretical best-effort fit — real stacking obeys carton strength, overhang and load-stability rules it does not model.
Related: ldm_calculator (pallets into trailer length), vehicle_lookup (pallet capacity per vehicle), container_lookup (pallets into containers).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| box_width_cm | Yes | Box width in cm. | |
| box_height_cm | Yes | Box height in cm. | |
| box_length_cm | Yes | Box length in cm. | |
| box_weight_kg | No | Weight per box in kg — enables the weight-capping check. | |
| allow_rotation | No | Try 90-degree box rotation for the best layer fit. Default: true. | |
| max_payload_kg | No | Maximum pallet payload in kg. Example: 1000. | |
| pallet_width_cm | Yes | Pallet width in cm. Example: 80 (euro pallet). | |
| pallet_length_cm | Yes | Pallet length in cm. Example: 120 (euro pallet). | |
| pallet_max_height_cm | Yes | Maximum stack height in cm INCLUDING the pallet deck. Example: 180. | |
| pallet_deck_height_cm | No | Pallet deck height in cm. Default: 15. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| result | Yes | ||
| _source | Yes | ||
| citation | Yes | ||
| validity | No | ||
| warnings | No | ||
| confidence | Yes | ||
| blocking_errors | No | ||
| envelope_version | Yes | ||
| normalized_input | No |