Skip to content

Bin Packing Calculator

Pack labelled item sizes into equal-capacity bins with deterministic FFD placement, utilization, and a size lower bound.

Privacy: your files never leave your device. All processing happens locally in your browser.

How to use

  1. 1.Enter the common capacity available in every bin.
  2. 2.List one item per line as size or label, size, using the same unit as capacity.
  3. 3.Run FFD, inspect every bin and the lower bound, then copy the plan if appropriate.

About Bin Packing Calculator

Bin Packing Calculator assigns positive item sizes to as many equal-capacity bins as needed. Enter one capacity and list either a size or label, size on each line. The result shows the number of bins, every assignment, used and remaining capacity, overall utilization, and the simple size-based lower bound. Copy the plan for a worksheet, loading draft, memory-allocation example, or operations-research exercise. Processing stays entirely in the browser.

The bin-packing problem asks for the fewest fixed-capacity bins that can hold all items, with each item assigned exactly once and no bin exceeding capacity. Google OR-Tools documents those constraints and the minimum-bin objective. This page uses the First Fit Decreasing heuristic rather than an integer-programming solver: sort items largest first, then put each into the first already-open bin where it fits; open a new bin only when necessary.

The algorithm is deterministic. Equal sizes retain their original order, and “first” always means the earliest open bin. That makes saved examples reproducible and lets you audit why an item reached a particular bin. Eight hand-checked cases cover exact pairs, repeated values, fractions, and arrangements where ordering matters. Tests also assert item conservation and capacity on every returned bin.

FFD does not guarantee the globally smallest bin count. Bin packing is computationally difficult, and a locally sensible early placement can prevent a better later combination. The displayed lower bound is ceil(total item size divided by capacity). No solution can use fewer bins than that size bound, but matching or exceeding it does not by itself prove optimality because individual item combinations also constrain feasibility. The interface labels both the heuristic and lower bound without turning either into a false certificate.

Sizes are abstract scalar quantities. They can represent weight, memory, workload, length, or another one-dimensional resource if capacity and every item share the same unit. They do not represent three-dimensional box dimensions, orientation, balance, fragility, stacking strength, center of gravity, hazardous separation, or vehicle axle limits. “Container loading” in the broad physical sense needs specialist software and safety rules.

Every item must be greater than zero and no larger than one bin. Negative or oversized items return a clear error. Capacity is bounded, labels are limited, and the list accepts at most 1,000 items. Rows with only a number receive automatic labels; rows with custom labels use one comma. Commas inside labels are outside this simple import format.

Utilization divides total item size by the total capacity of opened bins. Remaining capacity is unused space in the scalar model, not necessarily recoverable physical volume. The tool does not split items, combine capacities, reserve space, or apply values and priorities. Those variations become cutting stock, knapsack, multiple-knapsack, or scheduling problems with different objectives.

Use the plan to explore heuristics, draft batch groupings, or compare ordering effects, then validate all real-world constraints independently. For logistics, cloud capacity, manufacturing, or safety-critical loading, use a validated domain solver and confirm the final assignment. This page is transparent educational and planning assistance, not a proof of minimum cost or safe loading.

Methodology & sources

Validate up to 1,000 positive items no larger than a common capacity, stably sort by decreasing size, place each in the first open bin with sufficient remaining capacity, and open a new bin otherwise. Report conservation, utilization, and ceil(total/capacity) lower bound without claiming optimality.

Frequently asked questions

Is the returned bin count always optimal?
No. FFD is a fast heuristic and can use more bins than a globally optimal arrangement.
What does the lower bound mean?
It is ceil(total size/capacity), so no solution can use fewer bins, but it does not prove the displayed plan is optimal.
Can this load real boxes into a truck?
Not safely. The model uses one scalar size and ignores dimensions, orientation, balance, strength, and regulations.
Are items split between bins?
No. Every item is assigned whole to exactly one bin.

Calculators guides

View all