pallet_fitting_calculator
Calculate how many identical boxes fit on a pallet by layer, height, rotation, and weight limits, with totals, footprint, and volume utilisation.
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, footprint and 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, counted in whole layers (notes say when a part layer is left out, and why nothing fits when no box fits); pallet_deck_height_cm defaults to 15. Missing or non-positive dimensions error naming the parameter. Rate-limited: a limit error carries reset_at, the UTC time the allowance resets.
Returns: boxes_per_layer, layers, total_boxes, orientation, boxes_per_row/col, usable_height_cm, utilisation_percent (the share of the pallet FOOTPRINT one layer covers), volume_utilisation_percent (box volume over the usable envelope), total_box_volume_cbm, wasted_space_cbm, max_boxes_by_weight, notes and the weight fields under result, plus confidence, _source and citation (the FreightUtils v1 response envelope). Field names as this package serves them (snake_case); the hosted /api/mcp endpoint serves the same fields in camelCase (e.g. total_cbm → totalCbm).
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 |