# inventory.pallet-fit How many identical cartons fit on a pallet: per layer, how many layers, and in total, within a load height and an optional weight limit. **Pallets** are data (`data/pallets.json`): the UK standard pallet, 1200 x 1000 mm, and the EUR pallet (EPAL 1), 1200 x 800 mm, both ISO 6780 sizes. Cartons may not overhang the deck. **Layer pattern.** Cartons in a layer may be turned 90 degrees. The layer is the best *two-block* pattern: the deck is split once, across its length or its width, and each block is filled in a grid with the carton one way round. That includes the two plain grids, and it is where mixed patterns win: a 600 x 400 carton gets 4 a layer on a UK pallet in a plain grid, and 5 with a row turned (one of the vectors). It does not search the pinwheel and multi-block patterns of dedicated palletisation software, so on some awkward sizes it is a cautious answer, never an impossible one. **Upright or not.** With `upright` true the carton's height stays vertical, as "this way up" cartons must. With false, each of the three faces is tried down (height, then width, then length vertical) and the first stack holding the most cartons wins. **Limits.** `layers` is how many whole layers fit in `maxLoadHeightMm` (the height above the deck: take the pallet's own height, about 144 mm for a EUR pallet, off the vehicle or racking limit first). The pallet then holds `perLayer x layers` cartons, fewer if `maxLoadWeightGrams` is reached first; a part layer on top counts whole in `loadHeightMm`. `limitedBy` says which limit bound: `footprint` when a carton does not fit the deck at all, else `height` or `weight`. Carrier and racking limits vary (a typical UK pallet network allows about 1000 kg and 2200 mm overall), so they are arguments, not data. Dimensions and weights are whole millimetres and grams; dimensions must be positive, weights not negative. Sources: ISO 6780:2003 *Flat pallets for intercontinental materials handling - Principal dimensions and tolerances*; EPAL, "EPAL Euro pallet (EPAL 1)" (https://www.epal-pallets.org/eu-en/load-carriers/epal-euro-pallet), 800 x 1200 x 144 mm.