Bin packing is the problem of assigning indivisible items to equal-capacity bins while minimizing the number of bins needed. Every item must be assigned whole to exactly one bin, and the total size in a bin cannot exceed that bin’s common capacity. The objective is not simply to fill one container; it is to find a feasible grouping that uses as few containers as possible. In its one-dimensional form, “size” can stand for weight, memory, workload, length, or another single resource, provided every value uses the same unit. This is the practical problem addressed by the Bin Packing Calculator: it accepts one common capacity and up to 1,000 labeled item sizes, applies a deterministic First Fit Decreasing (FFD) heuristic, and reports the resulting bins, assignments, used and remaining capacity, overall utilization, and a size-based lower bound. Processing stays entirely in the browser, so the entered list does not need to be uploaded. FFD produces a valid plan under the scalar model, but it does not certify that the number of bins is the global minimum.

what is bin packing
What Is Bin Packing? Definition, Formula, and Steps

The objective behind a valid packing

Let the common bin capacity be C and let the item sizes be s1, s2, …, sn. A feasible packing follows two hard rules: each item appears in exactly one bin, and the sum of assigned item sizes in any bin is no greater than C. The optimization objective adds a third consideration: minimize the number m of bins opened. A grouping can therefore satisfy every constraint and still be inefficient because another feasible arrangement may use fewer bins. The formal minimum-bin framing and its constraints are also documented in Google OR-Tools — The Bin Packing Problem, which provides useful background when comparing heuristics with optimization models.

That distinction shapes the calculator’s behavior. It produces a deterministic First Fit Decreasing plan rather than running an integer-programming solver. FFD offers speed and repeatability, but its result is not automatically a proof of optimality. The calculator keeps the heuristic result and the lower bound clearly labeled so that neither can be mistaken for an optimality certificate.

Where the scalar model is useful

Bin packing gives each item one size and gives every bin the same capacity. That abstraction works when the planning question is “Which whole items belong together under this one limit?” It can support cloud memory allocation, manufacturing batch grouping, length-based material planning, weight grouping, and similar exercises. It does not turn an abstract size into a complete physical loading plan.

Planning scenario Item size represents Bin capacity represents
Memory allocation Job memory demand Common memory capacity
Batch grouping Job workload Common batch-workload limit
Length planning Part length Standard stock length
Weight grouping Item weight Common weight limit

These rows are scalar interpretations, not physical loading guarantees. Memory architecture rules, cutting allowances, handling restrictions, and safety requirements still need separate validation. For a focused explanation of this interpretation, see 1D Bin Packing Calculator: Pack Sizes into Bins.

Prepare compatible inputs

Begin with one common capacity and a list whose values all use the same unit. Enter the capacity available in each bin; do not mix kilograms, megabytes, hours, or another measure with a different unit. The item list accepts one entry per line. A row can contain only a number, in which case the calculator adds an automatic label, or a custom label followed by one comma and the size, such as “Batch A, 12”. Commas inside a custom label are outside this simple import format.

The model requires every item size to be greater than zero and no larger than one bin. Negative or oversized items return a clear error rather than being silently altered. The list holds at most 1,000 items, and the interface also enforces bounded capacity and label lengths. The tool can open as many equal-capacity bins as the assignment needs. All processing stays in the browser, and the input list does not need to be uploaded.

Create a bin-packing plan with FFD

  1. Enter the common capacity available in every bin. This value becomes the limit applied to every opened bin.
  2. List one item per line as either a size or as label, size. Use the same unit as the capacity, and keep each item whole.
  3. Run FFD. The calculator validates the items, sorts them by decreasing size, and places each one in the earliest already-open bin with enough remaining capacity; if none fits, it opens a new bin.
  4. Inspect every bin and the lower bound, then copy the plan if appropriate. Review the assignments, used capacity, remaining capacity, and overall utilization before reusing the result.

Because equal-sized items retain their original order and “first” always means the earliest open bin, the same valid input produces the same plan. That determinism makes examples reproducible and helps you audit why an item landed in a particular bin. The copyable plan can serve as a worksheet, a loading draft, a memory-allocation example, or an operations-research exercise.

Read the results and lower bound

The result reports the number of bins, every assignment, used and remaining capacity for each bin, and overall utilization. Utilization is total item size divided by the total capacity of the opened bins. Remaining capacity is unused space in the scalar model; it should not be read as physically recoverable volume.

The simple size lower bound is ceil(total item size ÷ capacity). For a worked example, if the total item size is 16 and the common capacity is 10, the bound is ceil(16 ÷ 10) = 2. No feasible solution can use fewer than two bins, because one bin cannot hold 16 units of item size under a capacity of 10. However, a lower bound of two does not prove that two bins are feasible for an arbitrary set of indivisible items.

Matching the displayed bin count to the lower bound provides useful context, but it is still not an optimality certificate. A lower-bound count can be unattainable because of individual item combinations, while an FFD count above the bound does not prove that no better arrangement exists. Read the number as a transparent benchmark, not as a separate solver verdict.

Why FFD may not find the fewest bins

First Fit Decreasing makes locally sensible choices. It processes larger items first and sends each item to the first open bin where it fits. A placement can leave a remainder that does not match a later item, even when another ordering would have produced a more compact grouping. FFD prioritizes a fast, deterministic plan rather than an exhaustive comparison of alternative assignments.

That distinction also explains the calculator’s labels: it reports the heuristic plan and the simple size lower bound without presenting either as a certificate of a globally smallest bin count. If an assignment must be proven optimal, use a validated optimization approach and confirm the objective and all constraints. For physical loading, cloud capacity, manufacturing, or other safety-critical use, validate the final plan independently.

What the scalar model does not cover

The calculator treats every item as an abstract scalar quantity. It does not model three-dimensional dimensions, orientation, balance, fragility, stacking strength, center of gravity, hazardous-material separation, or vehicle axle limits. It also does not split an item between bins, combine capacities, reserve space, or assign values and priorities. Those omissions are deliberate: cutting stock, knapsack, multiple-knapsack, and scheduling questions have different objectives and rules.

A row representing a physical box is only a number in this model. It cannot establish that the box will fit geometrically, stay stable, or meet transport regulations. 3D Bin Packing Calculator: When Scalar Packing Helps explains when a one-dimensional model is useful and where a physical model is required. Treat the generated plan as educational or planning assistance, never as a safe-loading certificate or a proof of minimum cost.

Choose the right solver for the decision

Use the calculator to explore a clear one-dimensional grouping problem, compare ordering effects, draft batch groupings, or prepare an operations-research exercise. Before applying the plan, confirm that all sizes use one unit, every item falls within the stated capacity, and any domain-specific restrictions have been checked elsewhere.

If stock cutting, valued selections, separate capacity limits, or timing constraints are central, select the matching problem class instead. Lehigh University’s An Analysis of Cutting Stock Problems provides background on cutting-stock variants. For decisions that need an optimality guarantee or safety validation, use a validated domain solver and confirm the final assignment.