What is Bin Packing?
The classic optimization problem that powers every nesting and cut list software—and why it matters for your material costs
EZNESTING Team
April 19, 2026
In This Guide
Bin Packing: The Quick Definition
Bin packing is the problem of fitting a set of items into the smallest number of containers (bins) without exceeding each bin's capacity.
The classic formulation is one-dimensional: you have items of various sizes and bins of fixed capacity, and you want to use as few bins as possible. In nesting and cut list software, the items are pieces you need to cut, and the bins are sheets of plywood, MDF, or other stock material.
Bin packing shows up everywhere: - Logistics — Fitting boxes onto trucks or pallets - Manufacturing — Cutting sheet goods, lumber, sheet metal - Cloud computing — Scheduling jobs on virtual machines - Memory allocation — Placing data structures in RAM - Loading containers — Filling shipping containers efficiently
Why does this matter? Every nesting optimizer is solving a bin packing problem. The quality of the algorithm determines how many sheets you buy, how much waste you produce, and how much your project costs. A 5% improvement in packing efficiency on a 50-sheet project saves 2-3 sheets—often hundreds of dollars per project.
The Classic Bin Packing Problem
The mathematical version of bin packing is simple to state but hard to solve.
The setup:
You have: - A list of items, each with a size (weight, length, area, volume) - Bins of fixed capacity
You want: - The minimum number of bins needed to hold all items - (Or equivalently, the maximum efficiency: total item size ÷ total bin capacity)
The simple example:
Items: 6, 5, 4, 4, 3, 2, 1 Bin capacity: 10
An efficient arrangement (3 bins): - Bin 1: 6, 4 = 10 - Bin 2: 5, 4, 1 = 10 - Bin 3: 3, 2 = 5
Total item size: 25. Theoretical minimum bins: 25 ÷ 10 = 2.5, rounded up to 3 bins. The arrangement above achieves 3 bins—optimal for this set.
Why this is harder than it looks:
For 7 items, you can try every possible arrangement and find the optimal. For 70 items, the number of possible arrangements explodes into the billions. For 700 items (a real cabinet project), no computer in the world can check every arrangement in your lifetime.
This is the heart of the bin packing problem: finding good solutions fast, even when finding the optimal solution is impossible in reasonable time.
1D Bin Packing vs 2D Bin Packing
Cutting problems come in two main flavors, and they're surprisingly different.
1D bin packing (linear materials):
Items have one dimension: length. Bins have one dimension: capacity.
Real-world example: Cutting molding from 16-foot lengths of stock. You need pieces of various lengths, and you want to use as few sticks as possible.
Used in EZNESTING's linear materials optimizer for lumber, trim, molding, pipe, conduit, and any one-dimensional cutting.
Why it's "easier": - Only one dimension to track - Simpler algorithms work well - Optimal solutions feasible for moderate problem sizes
2D bin packing (sheet goods):
Items have two dimensions: length and width. Bins have two dimensions: sheet length × sheet width.
Real-world example: Cutting cabinet parts from 4×8 sheets of plywood. You need rectangles of various sizes, and you want to use as few sheets as possible.
Used in EZNESTING's main nesting optimizer for plywood, MDF, melamine, sheet metal, glass, and any two-dimensional sheet material.
Why it's harder: - Two dimensions to track simultaneously - Items can be rotated, doubling the placement options - Cuts may need to be straight across the sheet (guillotine constraint) - "Wasted" space in one direction may not match what you need in the other
3D bin packing (rare in cutting, common in shipping):
Items have length, width, and height. Bins are containers or trucks.
Not relevant to flat sheet cutting, but worth knowing it exists. Container shipping companies and warehouse robots use 3D bin packing constantly.
The dimensionality penalty:
Each added dimension makes the problem dramatically harder. 1D problems with hundreds of items can find near-optimal solutions in seconds. 2D problems with the same item count take much longer and rarely find true optimal. 3D problems are computationally brutal.
Why Bin Packing is Hard (NP-Hard)
Bin packing is famous in computer science as an NP-hard problem. Here's what that means.
NP-hard, simply explained:
A problem is NP-hard if no known algorithm can solve it in reasonable time as the input size grows. The time required grows exponentially with the number of items—doubling the items doesn't double the time, it explodes the time.
The brute force approach:
Try every possible way to pack the items. With N items, there are roughly N! (N factorial) arrangements to check.
- 5 items: 120 arrangements (instant)
- 10 items: 3.6 million arrangements (still fast)
- 15 items: 1.3 trillion arrangements (minutes)
- 20 items: 2.4 quintillion arrangements (years)
- 50 items: more arrangements than atoms in the universe
Real cabinet projects have 100-500 pieces. Brute force is mathematically impossible.
The implication:
Every bin packing algorithm in the world makes a fundamental compromise: speed vs optimality. Faster algorithms find solutions quickly but may use more bins than necessary. Slower algorithms find better solutions but may take hours or days. Practical optimizers like EZNESTING choose algorithms that produce near-optimal results in seconds—usually within 1-5% of true optimal, which is good enough that the human can't see the difference.
Why approximation works:
For most real-world cutting problems, the true optimal solution exists somewhere in a vast search space. Many near-optimal solutions also exist, and any of them are acceptable. The job of a good bin packing algorithm is to find one of those many good solutions quickly, not to find the singular best one.
Common Bin Packing Algorithms
Researchers have developed many algorithms for bin packing. Here are the ones you're most likely to encounter in nesting software.
First Fit (FF)
Place each item in the first bin that has room. If no bin has room, open a new bin.
Pros: Fast, simple, easy to understand. Cons: Often uses more bins than necessary.
First Fit Decreasing (FFD)
Sort items from largest to smallest, then apply First Fit.
Pros: Much better than plain First Fit. A foundational algorithm in bin packing research. Cons: Still not optimal, but usually within 11/9 of optimal for 1D problems.
Best Fit (BF)
For each item, find the bin where it fits with the least leftover space. If no bin works, open a new one.
Pros: Often produces tighter packings than First Fit. Cons: Slower because it has to evaluate every bin for every item.
Best Fit Decreasing (BFD)
Sort items largest to smallest, then apply Best Fit. One of the most effective simple algorithms.
Bottom-Left Fill (BLF)
For 2D problems, place each item in the bottom-leftmost position where it fits. Items pack from the bottom up and left to right.
Pros: Fast, intuitive, produces visually clean layouts. Cons: Can leave awkward gaps that better algorithms avoid.
Guillotine algorithms
For 2D problems where cuts must go all the way across the sheet (like a panel saw), special algorithms ensure every cut is a guillotine cut. This is more restrictive than free-form 2D packing but matches how many real cutting operations work.
EZNESTING supports both guillotine and free (efficiency) cutting modes, picking algorithms appropriate to each.
Genetic algorithms and simulated annealing
For high-quality results, some optimizers use metaheuristics—algorithms that explore many possible packings and gradually refine toward better ones. These are slower but often find solutions close to optimal even on large problems.
Hybrid approaches
Most production nesting software combines multiple algorithms. A typical pipeline: 1. Start with a fast heuristic like FFD to get a baseline 2. Apply local search to improve the baseline 3. Run multiple times with different random seeds and keep the best result 4. Report the best layout found within the time budget
This is roughly how EZNESTING produces its layouts—fast enough to be interactive, smart enough to find layouts within a few percent of optimal.
Bin Packing in Nesting Software
When you run a nesting optimizer, here's what's happening under the hood.
Step 1: Input parsing
The software reads your cut list (pieces with dimensions, quantities, and constraints) and your stock list (sheets with dimensions and quantities).
Step 2: Constraint setup
For each piece, the software notes: - Can it be rotated? (Grain direction) - What's the minimum spacing around it? (Kerf width) - Are there edge banding or labeling requirements?
For each sheet, it notes: - Total usable area (after edge trim) - Cut style required (guillotine vs free)
Step 3: Algorithm selection
Based on the problem size and constraints, the software picks an algorithm. Small problems may use exhaustive search; larger problems use heuristics like FFD with refinement.
Step 4: Packing
The algorithm places pieces onto sheets, opening new sheets as needed. For each placement, it considers: - Does the piece fit? - Does it leave usable leftover space? - Does it respect rotation locks and other constraints?
Step 5: Improvement passes
Most modern algorithms run multiple iterations, swapping pieces between positions to find better packings. The software keeps the best layout found within its time budget.
Step 6: Output
The final layout is rendered as a cutting diagram, statistics are calculated (utilization, waste, total cuts), and the result is presented to you.
Speed vs quality:
Interactive optimizers like EZNESTING aim to return results in 1-5 seconds for typical cabinet projects. Industrial CAM software may run for hours on large problems to squeeze out the last percent of efficiency. The right balance depends on your use case—a hobbyist saves time with fast optimization, a production shop saves money with slow, thorough optimization.
What "good" looks like:
A well-tuned bin packing algorithm typically achieves 80-95% sheet utilization on real cabinet projects. The remaining 5-20% is unavoidable waste due to piece shapes, kerf, edge trim, and the geometric reality that rectangles don't always fit perfectly into other rectangles.
The Trade-Off: Speed vs Optimality
Every nesting optimizer chooses a point on the spectrum from "instant but rough" to "perfect but slow." Understanding this trade-off helps you pick the right tool.
Instant (sub-second)
Simple heuristics like First Fit. Used in basic free tools. Layouts may use 5-15% more material than necessary.
Best for: Quick estimates, single-piece projects, testing what-if scenarios.
Fast (1-10 seconds)
Modern hybrid algorithms with limited refinement. Layouts within 1-5% of optimal for typical projects.
Best for: Interactive work, daily use, most cabinet shops, EZNESTING's default mode.
Thorough (1-10 minutes)
Multiple algorithms run in parallel, extensive local search, genetic algorithms. Layouts often within 0.5-2% of optimal.
Best for: High-value projects where every sheet matters, production runs, exotic materials.
Exhaustive (hours to days)
Full search of the solution space, advanced metaheuristics, custom problem-specific tuning. Approaches true optimal.
Best for: Industrial CAM software, problems where the same cut layout repeats hundreds of times, materials that cost more than the computing time.
The diminishing returns curve:
Going from 0 seconds to 1 second of optimization typically improves utilization by 5-10 percentage points. Going from 1 second to 10 seconds improves it by another 1-2 percentage points. Going from 10 seconds to 10 hours improves it by maybe another 0.5 percentage points.
For most projects, "fast" mode produces results that are visually indistinguishable from "exhaustive" mode. Spending hours of compute time to save half a sheet of plywood usually doesn't make sense—unless you're cutting that same layout a thousand times.
Factors That Affect Packing Quality
Not all cut lists pack equally well. Some factors make optimization harder—and reveal why your utilization varies project to project.
Piece size variation
Cut lists with many similarly-sized pieces pack tightly. Cut lists with a wild mix of sizes leave awkward gaps.
Example: 50 identical cabinet doors pack to 95%+ utilization. A mix of 10 doors, 30 shelves, and 60 small parts may only hit 80%.
Piece-to-sheet ratio
Pieces that are large relative to the sheet pack worse than small pieces. A piece that's 49% of the sheet area means two pieces fit (with 2% waste); a piece that's 51% means one piece fits per sheet (with 49% waste).
Tip: If your project has pieces near half the sheet size, see if you can adjust dimensions to fit two per sheet.
Rotation constraints
Locking rotation (for grain direction) reduces the optimizer's options and worsens packing. Free rotation lets the algorithm fit pieces into more gaps.
Trade-off: Visual quality vs material efficiency. Lock rotation only on visible parts.
Kerf width
Wider kerf (thicker blade) means more space between pieces, which means fewer pieces per sheet. A thin kerf blade can pack 5-10% more pieces than a full kerf blade on a tight project.
Edge trim
If your sheets need edge trim (most do), the usable area is smaller than the sheet area. A 4×8 sheet with 0.25" trim per side has only ~3.96×7.96 of usable space.
Cutting style
Guillotine cuts (must go all the way across) are more restrictive than free cuts. Free cutting typically achieves 2-5% better utilization than guillotine cutting on the same cut list.
Pre-sorted vs random input
Most algorithms benefit from sorted input (largest first). Submitting a sorted cut list and a random cut list to the same algorithm can produce noticeably different results.
EZNESTING handles all of this internally—you just enter your pieces, sheets, and constraints, and the algorithm sorts and places automatically.
Common Bin Packing Misconceptions
Misconception 1: There's always a perfect layout
Reality: For all but trivial problems, true optimal is unknowable. Any layout that achieves 90%+ utilization on real cutting work is excellent.
Misconception 2: Slower algorithms always produce better results
Reality: Diminishing returns kick in fast. Going from 1 second to 10 minutes usually improves utilization by 1-2%, not 10%.
Misconception 3: The same cut list always produces the same layout
Reality: Many algorithms have a random component. Re-running may produce a slightly different layout, sometimes better, sometimes worse. Top tools run multiple times and keep the best.
Misconception 4: 100% utilization is the goal
Reality: 100% is mathematically impossible for almost any real cut list (due to kerf, edge trim, and piece geometry). 85-95% is excellent. 80% is normal for varied projects.
Misconception 5: Free software uses worse algorithms
Reality: The bin packing literature is open. Algorithms used in $5,000 CAM software are the same algorithms in good free tools. The differences are in features, integration, and support—not in raw algorithm quality.
Misconception 6: All optimizers produce the same result
Reality: Implementation quality varies widely. Two optimizers using "the same" algorithm can produce results that differ by 10% utilization. Always compare on your actual cut lists, not benchmarks.
Misconception 7: I can do this manually with graph paper
Reality: For 5-10 pieces, sure. For a real project with 100+ pieces, manual layout takes hours and produces results 10-30% worse than even basic software.
Frequently Asked Questions
What is bin packing in simple terms? Bin packing is the problem of fitting a set of items into the smallest number of containers without exceeding each container's capacity. In nesting software, the items are pieces to cut and the containers are sheets of stock material.
What is the difference between bin packing and the cutting stock problem? They're closely related. Bin packing minimizes the number of bins; cutting stock minimizes total material used. In practice, the two problems are often solved with the same algorithms, and the terms are sometimes used interchangeably.
Why is bin packing called NP-hard? NP-hard means no known algorithm can solve every instance optimally in time that grows polynomially with input size. For bin packing, the brute-force approach takes time that grows factorially—exploding from milliseconds to centuries as the item count increases.
What's the best bin packing algorithm? There's no single best algorithm. First Fit Decreasing (FFD) is the foundational simple algorithm. Modern production tools use hybrid approaches combining FFD-style heuristics with local search and metaheuristics like simulated annealing.
How accurate are bin packing algorithms? Modern fast algorithms typically produce results within 1-5% of true optimal for real cutting problems. For most projects, this is well within the noise of cutting tolerances and material variation.
Does bin packing software work for cutting plywood? Yes. Cutting plywood, MDF, melamine, and other sheet goods is a 2D bin packing problem. Software like EZNESTING uses 2D bin packing algorithms specifically tuned for cutting work, including kerf compensation, grain direction, and guillotine cut constraints.
What's the difference between 1D and 2D bin packing? 1D bin packing handles items with one dimension—length—like cutting molding or lumber from long stock. 2D bin packing handles items with length and width, like cutting cabinet parts from sheet goods. 2D is significantly harder to solve well.
Why doesn't my optimizer always find the perfect layout? Because perfect is computationally impossible for real-world problems. Modern optimizers find very good layouts quickly—usually within a few percent of theoretical optimal—and that's the right trade-off between speed and quality.
Why Bin Packing Matters to Your Bottom Line
Bin packing is invisible in your day-to-day work—until you realize that every sheet of plywood you buy was determined by an algorithm. The choice of algorithm, the quality of its implementation, and the constraints you give it directly determine your material costs.
The key takeaways:
- Bin packing is the algorithm behind nesting — every cut layout you see is a bin packing solution
- It's NP-hard — perfect solutions are mathematically impossible for real projects
- Modern algorithms get within 1-5% of optimal — that's good enough for almost any use case
- Speed vs optimality is a real trade-off — fast tools work for daily use; slow tools for high-stakes production
- Constraints matter — rotation locks, kerf, and edge trim all affect packing quality
You don't need to understand bin packing to use a nesting optimizer. But knowing what's happening under the hood helps you make better decisions—when to lock rotation, what utilization to expect, why your project takes the number of sheets it takes.
EZNESTING uses modern hybrid bin packing algorithms tuned for cutting work, with specific support for guillotine and free cuts, kerf compensation, grain direction, and edge trim. You get layouts within a few percent of optimal in seconds—free, no signup required.
Your sheets are expensive. Your algorithm shouldn't waste them.
Topics
See Bin Packing in Action
EZNESTING uses modern bin packing algorithms to produce near-optimal layouts in seconds. Try it on your next project—free.
Try Free Optimizer