The bin packing problem is an optimization problem whose goal is to assign every indivisible item exactly once to the fewest equal-capacity bins without exceeding any bin’s capacity.
The classic version treats each item’s size as a one-dimensional scalar quantity. Capacity and every item size use the same unit, which can represent weight, memory, workload, length, or another single resource. A feasible assignment respects the capacity limit; optimization asks whether fewer bins could be used while preserving every constraint.
For a practical one-dimensional workflow, the Bin Packing Calculator applies deterministic First Fit Decreasing (FFD), reports the resulting assignments and utilization, and keeps processing entirely in the browser without uploading the input.

What the bin packing problem asks you to decide
In the standard formulation, you know the common capacity and a list of item sizes. The decision is which items should share each bin. The solution must satisfy four core rules:
- Every bin has the same fixed capacity.
- Every item is assigned to exactly one bin.
- The sum of the sizes assigned to a bin cannot exceed its capacity.
- The objective is to minimize the number of bins used.
If T is the total item size and C is the capacity of one bin, a simple size-based lower bound is L = ceil(T ÷ C). The ceiling rounds a fractional result up because a partially filled bin still counts as a bin. No valid solution can use fewer than L bins. This bound uses total size alone, so indivisible item combinations can make the true minimum higher. The formal assignment constraints and minimum-bin objective are also described in Google OR-Tools’ bin-packing documentation.
Where bin packing sits among packing problems
Bin packing is related to several other allocation problems, but changing the objective or the treatment of items changes the problem. These distinctions matter when choosing the right model.
| Problem | Main objective | Distinguishing rule |
|---|---|---|
| Bin packing | Use the fewest bins | All items are assigned whole to equal-capacity bins |
| Cutting stock | Reduce material waste | Stock pieces can be cut into required sizes |
| 0/1 knapsack | Maximize selected value | A single capacity limits a subset of items |
| Multiple knapsack | Maximize value across several capacities | Values are central, and item selection can vary by bin |
The calculator’s scalar model belongs to the first row: it packs existing items and does not cut them into smaller pieces. For a more detailed comparison of the cutting-stock formulation, Lehigh University’s analysis of cutting stock problems explains why material waste and minimum-bin count are related but not interchangeable objectives.
Why a simple packing rule can miss the minimum
Bin packing is computationally difficult, so a heuristic offers a quick way to produce a valid draft without claiming that the result is a mathematical minimum. The FFD rule used by the calculator is straightforward:
- Sort the items from largest to smallest.
- Place each item in the earliest already-open bin with enough remaining capacity.
- Open a new bin only when no open bin can hold the item.
Equal-sized items retain their original input order, and “first” always means the earliest bin that was opened. This makes the algorithm deterministic: the same input produces the same assignment, and you can trace why an item reached a particular bin. The limitation is that a locally sensible early placement can leave an awkward gap that prevents a better combination later, so FFD can use more bins than a globally optimal arrangement.
Build a reproducible packing plan
- Enter the common capacity available in every bin. Use one scalar capacity for all bins, and express every item size in the same unit.
- List one item per line. Enter either a size by itself, such as 60, or a label and size separated by one comma, such as Server A, 60. Rows containing only a number receive automatic labels. Custom labels use one comma to separate the label and size; additional commas inside a label are outside the supported format. The list accepts at most 1,000 items.
- Run FFD and inspect the result. The output shows the number of bins, every item assignment, used and remaining capacity for each bin, overall utilization, and the simple size-based lower bound. Inspect each bin, then copy the plan if appropriate for a worksheet, loading draft, memory-allocation example, or operations-research exercise.
Interpret the bin count, utilization, and lower bound
For a run with total item size T and m opened bins, overall utilization is U = T ÷ (mC). It measures the share of the opened bins’ combined scalar capacity that is occupied. Remaining capacity is simply the unused amount in the model, not necessarily space that can be recovered in a physical packing operation.
Consider one worked example with a bin capacity of 10 and item sizes 6, 5, 3, 2, 2, and 2. The total size is 6 + 5 + 3 + 2 + 2 + 2 = 20, so the size lower bound is ceil(20 ÷ 10) = 2.
Applying the documented FFD rule produces three valid bins:
- Bin 1: 6 + 3 = 9
- Bin 2: 5 + 2 + 2 = 9
- Bin 3: 2 = 2
After 6 opens the first bin and 5 opens the second, 3 fits in the first bin. The next two 2s fit in the second, while the final 2 opens a third bin. However, a different partition is 6 + 2 + 2 = 10 and 5 + 3 + 2 = 10, which uses only two bins. One bin cannot hold the total size of 20, so two is the minimum in this example. FFD therefore returns a valid but nonoptimal result.
This illustrates why the calculator labels the heuristic and the lower bound separately rather than presenting either as a false certificate. The lower bound can show that a plan uses more bins than a theoretically possible count, while individual item combinations continue to constrain what can actually be packed.
Model boundaries that affect the answer
The scalar bin-packing model is useful for exploration, but its assumptions determine which results are meaningful.
- Input bounds: Every item must be greater than zero and no larger than one bin. Negative or oversized items return a clear error. Capacity is bounded and labels are limited by the interface.
- One-dimensional quantities: Sizes represent a single resource, not physical geometry. The model does not represent three-dimensional dimensions, orientation, balance, fragility, stacking strength, center of gravity, hazardous-material separation, or vehicle axle limits.
- Whole items and a fixed objective: The calculator does not split items, combine capacities, reserve space, or apply item values and priorities. A cutting, valuation, reservation, or scheduling requirement needs a different model.
- Limited physical meaning: Remaining capacity is unused space in the scalar model, not necessarily recoverable physical volume. A low-utilization result may still be perfectly appropriate for a worksheet or memory-planning exercise.
Use the plan as a draft, not a final verdict
The calculator is useful for teaching the objective, drafting batch groupings, exploring a memory-allocation example, comparing ordering effects, and preparing an operations-research exercise. Because its placement process is deterministic, repeating the calculation makes it easier to audit an assignment or investigate why an item was placed where it was.
For logistics, cloud-capacity planning, manufacturing, or safety-critical loading, use a validated domain solver and confirm the final assignment against every real-world constraint. Broad physical container loading needs specialist software and safety rules. For more context, see when scalar packing differs from 3D bin packing. The calculator provides transparent educational and planning assistance, not proof of minimum cost or safe loading.